-
Notifications
You must be signed in to change notification settings - Fork 271
Represent FP4 E2M1 with SPV_EXT_ocp_microscaling_types #3828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vmaksimo
wants to merge
8
commits into
KhronosGroup:main
Choose a base branch
from
vmaksimo:fp4-e2m1-ocp-microscaling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cfcde9c
Represent FP4 E2M1 with SPV_EXT_ocp_microscaling_types
vmaksimo 28ac54b
Drop the SPV_INTEL_float4 representation of the FP4 E2M1 type
vmaksimo 64b8507
Revert "Drop the SPV_INTEL_float4 representation of the FP4 E2M1 type"
Qi-Ye-079 b5a581e
Improve tests
Qi-Ye-079 ce3f220
Fix test file locations and names
Qi-Ye-079 214e067
Fix comments
Qi-Ye-079 e57917a
Apply nit fix
Qi-Ye-079 07fc433
Add missing spirv-val check
Qi-Ye-079 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 5c50cbd25a40f8b60e44a2ccc2f1ba3c9e0d0299 | ||
| 575b6512579ebde466ed3dfc04e413439d14d95d |
56 changes: 56 additions & 0 deletions
56
test/extensions/EXT/SPV_EXT_ocp_microscaling_types/conversions_both_encodings.ll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| ; Checks that both the EXT builtins (SPV_EXT_ocp_microscaling_types, | ||
| ; Float4E2M1EXT encoding 4225) and the INTEL builtins (SPV_INTEL_float4, | ||
| ; Float4E2M1INTEL encoding 6214) can coexist in one module with both | ||
| ; extensions enabled, and that each conversion round-trips back to its own | ||
| ; builtin. | ||
|
|
||
| ; RUN: llvm-spirv %s -o %t.spv --spirv-ext=+SPV_INTEL_float4,+SPV_EXT_ocp_microscaling_types,+SPV_INTEL_int4 | ||
| ; RUN: llvm-spirv %t.spv -o %t.spt --to-text | ||
| ; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV | ||
| ; RUN: llvm-spirv %t.spv -o %t.rev.bc -r --spirv-target-env=SPV-IR | ||
| ; RUN: llvm-dis %t.rev.bc -o %t.rev.ll | ||
| ; RUN: FileCheck < %t.rev.ll %s --check-prefix=CHECK-LLVM | ||
|
|
||
| ; CHECK-SPIRV-DAG: Capability Float4EXT | ||
| ; CHECK-SPIRV-DAG: Capability Float4E2M1INTEL | ||
| ; CHECK-SPIRV-DAG: Extension "SPV_EXT_ocp_microscaling_types" | ||
| ; CHECK-SPIRV-DAG: Extension "SPV_INTEL_float4" | ||
|
|
||
| ; CHECK-SPIRV-DAG: Name [[#ext_conv:]] "ext_conv" | ||
| ; CHECK-SPIRV-DAG: Name [[#intel_conv:]] "intel_conv" | ||
|
|
||
| ; CHECK-SPIRV-DAG: TypeFloat [[#E2M1ExtTy:]] 4 4225 | ||
| ; CHECK-SPIRV-DAG: TypeFloat [[#E2M1IntelTy:]] 4 6214 | ||
|
|
||
| target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
| target triple = "spir-unknown-unknown" | ||
|
|
||
| ; CHECK-SPIRV: Function [[#]] [[#ext_conv]] [[#]] | ||
| ; CHECK-SPIRV: Bitcast [[#E2M1ExtTy]] [[#ExtCast:]] [[#]] | ||
| ; CHECK-SPIRV: FConvert [[#]] [[#]] [[#ExtCast]] | ||
|
|
||
| ; CHECK-LLVM-LABEL: ext_conv | ||
| ; CHECK-LLVM: call spir_func half @_Z36__builtin_spirv_ConvertE2M1ToFP16EXTi(i4 1) | ||
|
|
||
| define spir_func half @ext_conv() { | ||
| entry: | ||
| %r = call spir_func half @_Z36__builtin_spirv_ConvertE2M1ToFP16EXTi(i4 1) | ||
| ret half %r | ||
| } | ||
|
|
||
| declare dso_local spir_func half @_Z36__builtin_spirv_ConvertE2M1ToFP16EXTi(i4) | ||
|
|
||
| ; CHECK-SPIRV: Function [[#]] [[#intel_conv]] [[#]] | ||
| ; CHECK-SPIRV: Bitcast [[#E2M1IntelTy]] [[#IntelCast:]] [[#]] | ||
| ; CHECK-SPIRV: FConvert [[#]] [[#]] [[#IntelCast]] | ||
|
|
||
| ; CHECK-LLVM-LABEL: intel_conv | ||
| ; CHECK-LLVM: call spir_func half @_Z38__builtin_spirv_ConvertE2M1ToFP16INTELi(i4 1) | ||
|
|
||
| define spir_func half @intel_conv() { | ||
| entry: | ||
| %r = call spir_func half @_Z38__builtin_spirv_ConvertE2M1ToFP16INTELi(i4 1) | ||
| ret half %r | ||
| } | ||
|
|
||
| declare dso_local spir_func half @_Z38__builtin_spirv_ConvertE2M1ToFP16INTELi(i4) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.