flagos-ai / flagos-ai/FlagTree

[Bug][ppu] not supported float8_e4m3fn on ppu backend

Open
#975 0 comments 0 reactions 0 assignees View on GitHub
ppu
Dominant language
Python
Stars
350
Forks
149
Avg merge
2d 4h
Merged PRs (30d)
81

Description

docker image: egslingjun-registry.cn-wulanchabu.cr.aliyuncs.com/egslingjun/inference-xpu-pytorch:26.04-v2.1.0-vllm0.19.0-torch2.10-cu130-20260508

flagtree version: 0.6.1+ppu3.6

error messages:

```
Traceback (most recent call last):
File "/workspace/repro_triton_only.py", line 21, in
main()
File "/workspace/repro_triton_only.py", line 16, in main
_store_fp8[(1,)](x, y, BLOCK=64)
File "/usr/local/lib/python3.12/site-packages/triton/runtime/jit.py", line 399, in
return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/triton/runtime/jit.py", line 763, in run
kernel = self._do_compile(key, signature, device, constexprs, options, attrs, warmup)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/triton/runtime/jit.py", line 906, in _do_compile
kernel = self.compile(src, target=target, options=options.__dict__)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/triton/spec/ppu/triton/compiler/compiler.py", line 330, in compile
module = backend.make_ir(src, options, codegen_fns, module_map, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/triton/backends/compiler.py", line 64, in make_ir
return src.make_ir(self.target, options, codegen_fns, module_map, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/triton/spec/ppu/triton/compiler/compiler.py", line 106, in make_ir
return ast_to_ttir(self.fn, self, context=context, options=options, codegen_fns=codegen_fns,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
triton.compiler.errors.CompilationError: at 1:0:
def _store_fp8(x_ptr, y_ptr, BLOCK: tl.constexpr):
^
ValueError("type fp8e4nv not supported in this architecture. The supported fp8 dtypes are ('fp8e4b15', 'fp8e5')")
```
testcase:
cat test.py
```python
import torch
import triton
import triton.language as tl

@triton.jit
def _store_fp8(x_ptr, y_ptr, BLOCK: tl.constexpr):
offs = tl.arange(0, BLOCK)
x = tl.load(x_ptr + offs).to(tl.float32)
tl.store(y_ptr + offs, x.to(y_ptr.dtype.element_ty))

def main():
x = torch.rand(64, dtype=torch.float32, device="cuda")
y = torch.empty(64, dtype=torch.float8_e4m3fn, device="cuda")
_store_fp8[(1,)](x, y, BLOCK=64)
print("OK")

if __name__ == "__main__":
main()
```

reprocude command:

```
python test.py
```

Contributor guide

Open the contributing guide

Research direction

Start with test.py and reproduce the failure using python test.py. Then inspect triton/spec/ppu/triton/compiler/compiler.py around the compiler path shown in the traceback; done means the float8_e4m3fn example compiles and prints OK on the ppu backend.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.