Skip to content

[Easy] Add PyTorch fp8 dtypes to Triton#2279

Merged
ptillet merged 1 commit intotriton-lang:mainfrom
ipiszy:fp8
Sep 12, 2023
Merged

[Easy] Add PyTorch fp8 dtypes to Triton#2279
ptillet merged 1 commit intotriton-lang:mainfrom
ipiszy:fp8

Conversation

@ipiszy
Copy link
Copy Markdown
Contributor

@ipiszy ipiszy commented Sep 12, 2023

@ipiszy ipiszy requested a review from ptillet as a code owner September 12, 2023 00:48
@ptillet ptillet merged commit 37f1249 into triton-lang:main Sep 12, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants