Comments (2)
In another env I get a different error:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/triton/language/core.py", line 33, in wrapper
return fn(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/triton/language/core.py", line 912, in to
return semantic.bitcast(self, dtype, _builder)
File "/usr/local/lib/python3.10/dist-packages/triton/language/semantic.py", line 737, in bitcast
raise ValueError("Cannot bitcast data-type of size " + str(src_bits) + " to "
ValueError: Cannot bitcast data-type of size 32 to data-type of size 16
The above exception was the direct cause of the following exception:
triton.compiler.errors.CompilationError: at 13:12:
n_outer: core.constexpr = x.numel >> n_dims
shape: core.constexpr = [n_outer * 2**i, 2, 2**(n_dims - i - 1)]
y = core.reshape(x, shape)
# slice left/right with 'stride' 2**(n_dims - i - 1)
mask = core.arange(0, 2)[None, :, None]
left = core.broadcast_to(sum(y * (1 - mask), 1)[:, None, :], shape)
right = core.broadcast_to(sum(y * mask, 1)[:, None, :], shape)
left = core.reshape(left, x.shape)
right = core.reshape(right, x.shape)
# actual compare-and-swap
idtype = core.dtype(f'int{core.constexpr(x.dtype.primitive_bitwidth)}')
ileft = left.to(idtype, bitcast=True)
I think this error comes from below code in triton/language/standard.py
where mask
is in default type of int32, thus left
and right
turn out to be fp32 rather than bf16 like y
.
mask = core.arange(0, 2)[None, :, None]
left = core.broadcast_to(sum(y * (1 - mask), 1)[:, None, :], shape)
right = core.broadcast_to(sum(y * mask, 1)[:, None, :], shape)
So I try to cast left
and right
to dtype of y
like this:
mask = core.arange(0, 2)[None, :, None]
left = core.broadcast_to(sum(y * (1 - mask), 1)[:, None, :], shape).to(y.dtype)
right = core.broadcast_to(sum(y * mask, 1)[:, None, :], shape).to(y.dtype)
Then I get the same error as the beginning:
loc(callsite(callsite(callsite("/usr/local/lib/python3.10/dist-packages/triton/language/standard.py":338:34 at "/usr/local/lib/python3.10/dist-packages/triton/language/standard.py":363:61) at "/usr/local/lib/python3.10/dist-packages/triton/language/standard.py":376:66) at "/workspace2/triton-test/test.py":18:18)): error: 'llvm.fcmp' op operand #0 must be floating point LLVM type or LLVM dialect-compatible vector of floating point LLVM type, but got 'i16'
Traceback (most recent call last):
File "/workspace2/triton-test/test.py", line 49, in <module>
test_kernel[(8, )](a, b, 16, 16)
File "/usr/local/lib/python3.10/dist-packages/triton/runtime/jit.py", line 180, in <lambda>
return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/triton/runtime/jit.py", line 401, in run
self.cache[device][key] = compile(
File "/usr/local/lib/python3.10/dist-packages/triton/compiler/compiler.py", line 268, in compile
next_module = compile_ir(module, metadata)
File "/usr/local/lib/python3.10/dist-packages/triton/backends/nvidia/compiler.py", line 265, in <lambda>
stages["llir"] = lambda src, metadata: self.make_llir(src, metadata, options, self.capability)
File "/usr/local/lib/python3.10/dist-packages/triton/backends/nvidia/compiler.py", line 178, in make_llir
pm.run(mod)
RuntimeError: PassManager::run failed
I think the error comes from line 338 where llvm.fcmp
is not expected to be generated:
ret = ix ^ core.where((left > right) ^ flip, ileft ^ iright, zeros_like(ix))
FYI, thx.
from triton.
Fixed with #3975.
from triton.
Related Issues (20)
- Triton Error [CUDA]: device kernel image is invalid HOT 1
- Cannot specify which device to use HOT 2
- flash-attention gradient calculation fail due to numerical error HOT 1
- Hitting an assertion in `RemoveLayoutConversions` Pass. Relevant for both cuda and hip backends. HOT 2
- Help build WHL for Windows HOT 1
- How to add a pow function in python.triton.language.core? HOT 1
- tensor not support index in nvidia gpu?
- No matching distribution found for triton-nightly
- cdot minimal size operation?
- How to create a constant in kernel function
- It raises error when I run 06-fused-attention.py HOT 1
- s
- `03-matrix-multiplication.py` results in inaccurate numerics on H100 and MI300 using `float32` HOT 5
- Pytorch/Triton of 2.3.0 version loads bool type mask in triton, encountering error when use tl.where HOT 4
- Unable to download llvm when building from source. HOT 9
- can we use triton kernel in our model when using torch.onnx.export
- [BUG] Using both reduction and atomic operations along with autotune makes incorrect results HOT 2
- cross-compile triton kernels with tools/compile.py
- Enhance triton functionality to allow use of custom cuda toolkit instead of downloading specific version from conda
- Macos poetry add [email protected] installation triton error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from triton.