Skip to content
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

The CPU backend fails to handle the tt.get_program_id operation in the vector addition kernel #6

Open
SwapnilGhanshyala opened this issue Nov 25, 2024 · 0 comments

Comments

@SwapnilGhanshyala
Copy link

Bug Report: Error in Running tutorials/01-vector-add.py with TRITON_CPU_BACKEND

Command

TRITON_CPU_BACKEND=1 python tutorials/01-vector-add.py


```loc("01-vector-add.py":37:24): error: failed to legalize operation 'tt.get_program_id' that was explicitly marked illegal
Traceback (most recent call last):
  File "01-vector-add.py", line 87, in <module>
    output_triton = add(x, y)
  File "01-vector-add.py", line 73, in add
    add_kernel[grid](x, y, output, n_elements, BLOCK_SIZE=1024)
  File "triton/runtime/jit.py", line 209, in <lambda>
    return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs)
  File "triton/runtime/jit.py", line 526, in run
    kernel = self.compile(
  File "triton/compiler/compiler.py", line 278, in compile
    next_module = compile_ir(module, metadata)
  File "triton/backends/cpu/compiler.py", line 151, in <lambda>
    stages["llir"] = lambda src, metadata: self.make_llir(src, metadata, options)
  File "triton/backends/cpu/compiler.py", line 112, in make_llir
    pm.run(mod)
RuntimeError: PassManager::run failed

Steps
python -m venv .venv
source .venv/bin/activate
pip install ninja cmake wheel

TRITON_BUILD_WITH_CLANG_LLD=true TRITON_BUILD_WITH_CCACHE=true TRITON_CPU_BACKEND=1 pip install --no-build-isolation -e './python[tutorials]'

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

No branches or pull requests

1 participant