Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Modify and add new pipeline shader option#1338

Merged
JaxLinAMD merged 2 commits intoGPUOpen-Drivers:devfrom
jiaolu:nocontract
Aug 10, 2021
Merged

Modify and add new pipeline shader option#1338
JaxLinAMD merged 2 commits intoGPUOpen-Drivers:devfrom
jiaolu:nocontract

Conversation

@jiaolu
Copy link
Copy Markdown
Contributor

@jiaolu jiaolu commented Jul 29, 2021

  1. Refactor SPIRVGenFastMath option to enable more fastmathflag setting
    through -spirv-gen-fast-math in llpcOptions
  2. Add new shader pipeline option to disable contract fastmath flag for
    the dot product

Fastmath contract flag could generate v_fma_f32 in the dot product
function.

fma in the dot function somehow has some errors.

v1:-0.499996 -0.374997 -0.999991, v1:0.110096 -0.110096 -0.013762

dot(v0,v1)

before:
c++: 0x31000000 float:1.86265e-09
llpc: 0xAFB54C20 float:-3.29778e-10

after:
llpc: 0x31000000 float:1.86265e-09

sp3 code:
before:
v_mul_f32 v2, v6, v2
v_fma_f32 v0, v4, v0, v2
v_fma_f32 v0, v8, v10, v0

after:
v_mul_f32 v0, v4, v0
v_mul_f32 v2, v6, v2
v_mul_f32 v4, v8, v10
v_add_f32 v0, v0, v2
v_add_f32 v0, v4, v0

@jiaolu jiaolu requested a review from amdrexu as a code owner July 29, 2021 10:01
@amdvlk-admin
Copy link
Copy Markdown

Test summary for commit 3cfbaee

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • PAL: dev 408fbcdd1249dea3469bbd3426c29ca344386d6f
  • SPVGEN: dev bb3da8bc00bcf4373d563bf9b3c74a80a8b28fe6
  • XGL: dev 5b352af27e8877ab65b95636d4bed34ebbe02115
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 53de8fec5020e6fec5411a795ce8c38fae6516ac
CTS tests (Failed: 0/228188)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 32228/57047 (56.5%)
    • Failed: 0/57047 (0.0%)
    • Not Supported: 24819/57047 (43.5%)
    Ubuntu 18.04, Gfx9
    • Passed: 32226/57047 (56.5%)
    • Failed: 0/57047 (0.0%)
    • Not Supported: 24821/57047 (43.5%)
    Ubuntu 20.04, Gfx8
    • Passed: 32530/57047 (57.0%)
    • Failed: 0/57047 (0.0%)
    • Not Supported: 24517/57047 (43.0%)
    Ubuntu 20.04, Gfx103
    • Passed: 35505/57047 (62.2%)
    • Failed: 0/57047 (0.0%)
    • Not Supported: 21542/57047 (37.8%)

Copy link
Copy Markdown
Contributor

@amdrexu amdrexu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amdrexu
Copy link
Copy Markdown
Contributor

amdrexu commented Aug 4, 2021

As we discussed locally, this could be a HW problem of FMA. Consider if you still need this option.

@JaxLinAMD
Copy link
Copy Markdown
Contributor

@jiaolu jiaolu force-pushed the nocontract branch 2 times, most recently from fe6bb3c to 04d6829 Compare August 9, 2021 05:28
amdrexu
amdrexu previously approved these changes Aug 9, 2021
1. Refactor SPIRVGenFastMath option to enable more fastmathflag setting
   through -spirv-gen-fast-math in llpcOptions
2. Add new shader pipeline option to disable contract fastmath flag for
   the dot product

Fastmath contract flag could generate v_fma_f32 in the dot product
function.

fma in the dot function somehow has some errors.

v1:-0.499996 -0.374997 -0.999991, v1:0.110096 -0.110096 -0.013762

dot(v0,v1)

before:
c++: 0x31000000    float:1.86265e-09
llpc:   0xAFB54C20   float:-3.29778e-10

after:
llpc:   0x31000000    float:1.86265e-09

sp3 code:
before:
v_mul_f32 v2, v6, v2
v_fma_f32 v0, v4, v0, v2
v_fma_f32 v0, v8, v10, v0

after:
v_mul_f32 v0, v4, v0
v_mul_f32 v2, v6, v2
v_mul_f32 v4, v8, v10
v_add_f32 v0, v0, v2
v_add_f32 v0, v4, v0
@amdvlk-admin
Copy link
Copy Markdown

Test summary for commit 04d6829

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • PAL: dev 0e83f232d8b70c6823f62bbd9dbf286a68037fe2
  • SPVGEN: dev a46945586e83a71cb07b11936eb5fe503afd6360
  • XGL: dev a1cbd305b2745124f1ec6e924fb4934cb9d4af34
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 9afbdfdf92f4fea339d4c9fdd9178856abd6bdfd
CTS tests (Failed: 0/228724)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 32108/57181 (56.2%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 25073/57181 (43.8%)
    Ubuntu 18.04, Gfx9
    • Passed: 32108/57181 (56.2%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 25073/57181 (43.8%)
    Ubuntu 20.04, Gfx8
    • Passed: 32488/57181 (56.8%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 24693/57181 (43.2%)
    Ubuntu 20.04, Gfx103
    • Passed: 35419/57181 (61.9%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 21762/57181 (38.1%)

amdrexu
amdrexu previously approved these changes Aug 9, 2021
@amdvlk-admin
Copy link
Copy Markdown

Test summary for commit a45af42

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • PAL: dev 0e83f232d8b70c6823f62bbd9dbf286a68037fe2
  • SPVGEN: dev a46945586e83a71cb07b11936eb5fe503afd6360
  • XGL: dev a1cbd305b2745124f1ec6e924fb4934cb9d4af34
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 9afbdfdf92f4fea339d4c9fdd9178856abd6bdfd
CTS tests (Failed: 2/228724)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 32108/57181 (56.2%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 25073/57181 (43.8%)
    Ubuntu 18.04, Gfx9
    • Passed: 32106/57181 (56.1%)
    • Failed: 2/57181 (0.0%)

      Failures:

      FAILURE: dEQP-VK.memory.pipeline_barrier.host_read_host_write.65536
      Stack trace: Script:
      44:HostMemoryAccess Result differs from reference, Expected: 0x00000061, Got: 0x000000a2, At offset: 39468
      
      
      FAILURE: dEQP-VK.memory.pipeline_barrier.host_read_host_write.1048576
      Stack trace: Script:
      15:HostMemoryAccess Result differs from reference, Expected: 0x0000009e, Got: 0x000000ba, At offset: 23328
      
      

    • Not Supported: 25073/57181 (43.8%)
    Ubuntu 20.04, Gfx8
    • Passed: 32488/57181 (56.8%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 24693/57181 (43.2%)
    Ubuntu 20.04, Gfx103
    • Passed: 35419/57181 (61.9%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 21762/57181 (38.1%)

@amdvlk-admin
Copy link
Copy Markdown

Test summary for commit 18e13b3

Driver commits used in build
  • CWPACK: amd-master 7387247eb9889ddcabbc1053b9c2052e253b088e
  • METROHASH: amd-master 3c566dd9cda44ca7fd97659e0b53ac953f9037d2
  • PAL: dev 0e83f232d8b70c6823f62bbd9dbf286a68037fe2
  • SPVGEN: dev a46945586e83a71cb07b11936eb5fe503afd6360
  • XGL: dev a1cbd305b2745124f1ec6e924fb4934cb9d4af34
  • LLVM-PROJECT: amd-gfx-gpuopen-dev 9afbdfdf92f4fea339d4c9fdd9178856abd6bdfd
CTS tests (Failed: 0/228724)
  • Built with version 1.2.5.2
  • Rhel 8.2, Gfx10
    • Passed: 32108/57181 (56.2%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 25073/57181 (43.8%)
    Ubuntu 18.04, Gfx9
    • Passed: 32108/57181 (56.2%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 25073/57181 (43.8%)
    Ubuntu 20.04, Gfx8
    • Passed: 32488/57181 (56.8%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 24693/57181 (43.2%)
    Ubuntu 20.04, Gfx103
    • Passed: 35419/57181 (61.9%)
    • Failed: 0/57181 (0.0%)
    • Not Supported: 21762/57181 (38.1%)

@JaxLinAMD JaxLinAMD merged commit 38ae606 into GPUOpen-Drivers:dev Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants