Skip to content

Unsupport op reported during triton kernel compile #304

@bin913

Description

@bin913

Describe the bug

Unsupport op reported during triton kernel compile, when run test_flash_attn_varlen_func in ascend 910B,
code link:
https://github.com/bin913/FlagGems/tree/flash_attn_varlen_test
run test:
cd FlagGems/tests
pytest test_attention_ops.py::test_flash_attn_varlen_func -v -s
report error:
subprocess.CalledProcessError: Command '['/usr/local/Ascend/ascend-toolkit/latest/bin/bishengir-compile', '/tmp/tmpondme4ko/kernel.ttadapter.mlir', '--target=Ascend910B3', '--enable-auto-multi-buffer=True', '--enable-auto-bind-sub-block=True', '--enable-hfusion-compile=true', '--enable-hivm-compile=true', '--enable-triton-kernel-compile=true', '-o', '/tmp/tmpondme4ko/kernel']' returned non-zero exit status 1.
/usr/local/python3.11.13/lib/python3.11/subprocess.py:571: CalledProcessError
...
E loc("/tmp/bishengir-compile-fb5d91/module.hivm.mlir":126:16): error: 'tensor.empty' op Unsupported op for finding the root alloc.
E loc("/tmp/bishengir-compile-fb5d91/module.hivm.mlir":205:16): error: 'hivm.hir.vcast' op Unsupported op for finding the root alloc.
E: loc("/tmp/bishengir-compile-fb5d91/module.hivm.mlir":166:16): error: 'hivm.hir.load' op Unsupported op for finding the root
alloc.

Analysis of Causes
Run single test for tensor.empty pass, so tensor.empty is not root cause.
Dynamic shape was introduced in flash_atten_varlen_kernel, and it may be the root cause of the error. other kernel with static shape is OK.

Environment details

Triton: 3.2
NPU: ascend 910B
system: Ubuntu22.04
CANN: 8.5.0.alpha002
flagtree: 0.4.0+ascend3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions