[Easy] Add PyTorch fp8 dtypes to Triton#2279
Merged
ptillet merged 1 commit intotriton-lang:mainfrom Sep 12, 2023
Merged
Conversation
ptillet
approved these changes
Sep 12, 2023
alexander-zinoviev
pushed a commit
to alexander-zinoviev/triton
that referenced
this pull request
Sep 21, 2023
pingzhuu
pushed a commit
to siliconflow/triton
that referenced
this pull request
Apr 2, 2024
ssam18
added a commit
to ssam18/pytorch
that referenced
this pull request
Apr 1, 2026
Triton now natively maps PyTorch fp8 dtype names to its own type strings (triton-lang/triton#2279, merged Sep 2023), so the manual mapping in signature_of() is redundant. Remove the four hand-rolled if/elif branches and let all fp8 dtypes fall through to _type_of(), adding the two missing entries (float8_e4m3fnuz, float8_e5m2fnuz) to its lookup table as well. Fix for the issue pytorch#178938
WeishuZ
added a commit
to WeishuZ/pytorch
that referenced
this pull request
Apr 1, 2026
…8938) Triton now natively supports PyTorch fp8 dtypes (triton-lang/triton#2279), so the manual dtype-to-Triton-type mapping in `signature_of()` is redundant with `_type_of()` in utils.py. Changes: - Remove the fp8 special-case branches in `signature_of()` and delegate all dtype-to-signature mapping to `_type_of()` - Add missing `float8_e4m3fnuz` and `float8_e5m2fnuz` entries to the `_type_of()` mapping table (these were previously only handled by the now-removed special case) Fixes pytorch#178938
Rishi-Dave
added a commit
to Rishi-Dave/pytorch
that referenced
this pull request
Apr 3, 2026
Triton has supported PyTorch fp8 dtypes natively since triton-lang/triton#2279 (Sep 2023), making the hard-coded fp8 if/elif branches in `signature_of()` redundant. This removes those branches and delegates all dtype-to-Triton-type mapping to the centralized `_type_of()` utility, adding the two missing fnuz variant entries (`float8_e4m3fnuz` and `float8_e5m2fnuz`). Fixes pytorch#178938
tysoncung
added a commit
to tysoncung/pytorch
that referenced
this pull request
Apr 3, 2026
…78938) Remove the manual fp8 dtype-to-Triton-type mapping in `signature_of` and fall through to the existing `_type_of` helper, which already handles the standard fp8 dtypes. Add the two missing fnuz variants (`float8_e4m3fnuz` → `fp8e4b8`, `float8_e5m2fnuz` → `fp8e5b16`) to `_type_of` so all four fp8 types are covered in the single canonical mapping. The referenced Triton PR (triton-lang/triton#2279) that added native PyTorch fp8 dtype support was merged in Sep 2023, making the TODO and special-case branches in `signature_of` redundant. Closes pytorch#178938
pytorchmergebot
pushed a commit
to ssam18/pytorch
that referenced
this pull request
Apr 4, 2026
Triton now natively maps PyTorch fp8 dtype names to its own type strings (triton-lang/triton#2279, merged Sep 2023), so the manual mapping in signature_of() is redundant. Remove the four hand-rolled if/elif branches and let all fp8 dtypes fall through to _type_of(), adding the two missing entries (float8_e4m3fnuz, float8_e5m2fnuz) to its lookup table as well. Fix for the issue pytorch#178938
Rishi-Dave
added a commit
to Rishi-Dave/pytorch
that referenced
this pull request
Apr 4, 2026
Triton natively supports PyTorch fp8 dtypes since triton-lang/triton#2279, so the manual if/elif mapping in `signature_of` is redundant. Remove the four special-case branches and let all fp8 dtypes fall through to `_type_of`, which already handled `float8_e4m3fn` and `float8_e5m2`. Add the two missing fnuz variants (`float8_e4m3fnuz` → `fp8e4b8`, `float8_e5m2fnuz` → `fp8e5b16`) to `_type_of` so they resolve correctly through the common path. Fixes pytorch#178938
Rishi-Dave
added a commit
to Rishi-Dave/pytorch
that referenced
this pull request
Apr 5, 2026
Triton has supported PyTorch fp8 dtypes since triton-lang/triton#2279 (September 2023), making the manual if/elif branches in signature_of() redundant. This removes those branches and adds the two missing fnuz variant mappings (float8_e4m3fnuz, float8_e5m2fnuz) to _type_of() so all fp8 dtypes now flow through the same unified code path. Fixes pytorch#178938
muhammadrashid4587
pushed a commit
to muhammadrashid4587/pytorch
that referenced
this pull request
Apr 6, 2026
Triton now natively supports PyTorch fp8 dtypes (triton-lang/triton#2279), so the manual if/elif mapping in signature_of is redundant. Move the two missing fnuz dtype mappings (float8_e4m3fnuz, float8_e5m2fnuz) into _type_of where all other dtype mappings live, then simplify signature_of to always delegate to _type_of. This PR was authored with the help of AI (Claude). Fixes pytorch#178938
Rishi-Dave
added a commit
to Rishi-Dave/pytorch
that referenced
this pull request
Apr 6, 2026
Triton now natively supports PyTorch fp8 dtypes (triton-lang/triton#2279), so the manual if/elif mapping in `signature_of()` is redundant. Remove the four fp8 special-case branches and let all dtypes route through `_type_of()`. Add the two missing fnuz variant mappings (`float8_e4m3fnuz` → `fp8e4b8`, `float8_e5m2fnuz` → `fp8e5b16`) to `_type_of()` so the unified path produces identical Triton type strings. The other two fp8 types were already mapped correctly. Fixes pytorch#178938
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Apr 6, 2026
The Triton PR triton-lang/triton#2279 (merged Sep 2023) added native support for PyTorch fp8 dtype names, making the manual mapping in `signature_of()` inside `triton_utils.py` obsolete. This PR removes the four hand-rolled `if/elif` branches and lets all fp8 dtypes fall through to the existing `_type_of()` path. Two previously missing entries (`float8_e4m3fnuz` and `float8_e5m2fnuz`) are also added to `_type_of()`'s lookup table to match the existing Triton mapping. A unit test is added to `test/inductor/test_codegen_triton.py` to verify all four fp8 dtypes produce the correct Triton pointer type strings via `signature_of()`. Pull Request resolved: #178957 Approved by: https://github.com/jansel
nklshy-aws
pushed a commit
to nklshy-aws/pytorch
that referenced
this pull request
Apr 7, 2026
…8957) The Triton PR triton-lang/triton#2279 (merged Sep 2023) added native support for PyTorch fp8 dtype names, making the manual mapping in `signature_of()` inside `triton_utils.py` obsolete. This PR removes the four hand-rolled `if/elif` branches and lets all fp8 dtypes fall through to the existing `_type_of()` path. Two previously missing entries (`float8_e4m3fnuz` and `float8_e5m2fnuz`) are also added to `_type_of()`'s lookup table to match the existing Triton mapping. A unit test is added to `test/inductor/test_codegen_triton.py` to verify all four fp8 dtypes produce the correct Triton pointer type strings via `signature_of()`. Pull Request resolved: pytorch#178957 Approved by: https://github.com/jansel
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add PyTorch fp8 dtypes (https://github.com/pytorch/pytorch/blob/8025b193a966a6d8e3afc9c03a54e577bc04eb3d/torchgen/api/types/types.py#L50-L51) to Triton.