Skip to content

Commit 3f9701b

Browse files
committed
Merge commit '1b27b93fa5a4efdfef285581df4524189da81bba'
2 parents b5d9ad8 + 1b27b93 commit 3f9701b

File tree

7 files changed

+47
-22
lines changed

7 files changed

+47
-22
lines changed

.github/workflows/wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ jobs:
8888
export CIBW_MANYLINUX_AARCH64_IMAGE="quay.io/pypa/manylinux_2_28_${{ matrix.config.arch }}:latest"
8989
fi
9090
91-
export CIBW_BUILD="cp3{9,10,11,12,13,13t,14,14t}-manylinux_${{ matrix.config.arch }}"
92-
export CIBW_SKIP="cp{35,36,37,38}-*"
91+
export CIBW_BUILD="cp3{10,11,12,13,13t,14,14t}-manylinux_${{ matrix.config.arch }}"
92+
export CIBW_SKIP="cp{35,36,37,38,39}-*"
9393
export CIBW_ENABLE=cpython-freethreading
9494
python3 -m cibuildwheel . --output-dir wheelhouse
9595

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You can install the latest stable release of Triton from pip:
3838
pip install triton
3939
```
4040

41-
Binary wheels are available for CPython 3.10-3.13.
41+
Binary wheels are available for CPython 3.10-3.14.
4242

4343
# Install from source
4444

docs/getting-started/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ You can install the latest stable release of Triton from pip:
1414
1515
pip install triton
1616
17-
Binary wheels are available for CPython 3.10-3.13.
17+
Binary wheels are available for CPython 3.10-3.14.
1818

1919
-----------
2020
From Source

python/test/gluon/test_frontend.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2634,3 +2634,39 @@ def test_get_num_warps():
26342634
print_num_warps()
26352635
ttgl.warp_specialize((), print_num_warps, (), [print_num_warps, print_num_warps, print_num_warps], [1, 2, 8],
26362636
[24, 24, 24])
2637+
2638+
2639+
def test_non_scalar_loop_bounds():
2640+
2641+
@gluon.jit
2642+
def kernel():
2643+
x = ttgl.full([32], 0, ttgl.int32, layout=ttgl.BlockedLayout([1], [32], [1], [0]))
2644+
for _ in range(x, 10, 1):
2645+
pass
2646+
2647+
with pytest.raises(CompilationError) as e:
2648+
run_parser(kernel)
2649+
2650+
assert "For lower bound must be a scalar, got" in str(e.value)
2651+
2652+
@gluon.jit
2653+
def kernel():
2654+
x = ttgl.full([32], 0, ttgl.int32, layout=ttgl.BlockedLayout([1], [32], [1], [0]))
2655+
for _ in range(1, x, 1):
2656+
pass
2657+
2658+
with pytest.raises(CompilationError) as e:
2659+
run_parser(kernel)
2660+
2661+
assert "For upper bound must be a scalar, got" in str(e.value)
2662+
2663+
@gluon.jit
2664+
def kernel():
2665+
x = ttgl.full([32], 0, ttgl.int32, layout=ttgl.BlockedLayout([1], [32], [1], [0]))
2666+
for _ in range(1, 10, x):
2667+
pass
2668+
2669+
with pytest.raises(CompilationError) as e:
2670+
run_parser(kernel)
2671+
2672+
assert "For step must be a scalar, got" in str(e.value)

python/triton/compiler/code_generator.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,12 @@ def visit_For(self, node):
11781178
# induction variable type
11791179
if not lb.dtype.is_int() or not ub.dtype.is_int() or not step.dtype.is_int():
11801180
raise TypeError(f"For loop bounds and step must all be ints, are ({lb.dtype}, {ub.dtype}, {step.dtype})")
1181+
if _is_non_scalar_tensor(lb):
1182+
raise TypeError(f"For lower bound must be a scalar, got {lb.type}")
1183+
if _is_non_scalar_tensor(ub):
1184+
raise TypeError(f"For upper bound must be a scalar, got {ub.type}")
1185+
if _is_non_scalar_tensor(step):
1186+
raise TypeError(f"For step must be a scalar, got {step.type}")
11811187
iv_type = self.semantic.integer_promote_impl(lb.dtype, ub.dtype)
11821188
iv_type = self.semantic.integer_promote_impl(iv_type, step.dtype)
11831189
iv_ir_type = iv_type.to_ir(self.builder)

python/triton_kernels/triton_kernels/roofline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def interp(yxs, yys, x):
266266
xmin, xmax = xs[0], xs[-1]
267267
dx = 0.05 * (xmax - xmin) if xmax > xmin else 1.0
268268
ax.set_xlim(xmin - dx, xmax + dx)
269-
ax.set_ylim(min(y_roof) * 0.8 if y_roof else 0.0, max_tflops * 1.05)
269+
ax.set_ylim(min(min(perf) for perf in series_perf) * 0.8 if series_perf else 0.0, max_tflops * 1.05)
270270

271271
# Points of interest
272272
if points_of_interest:

third_party/proton/csrc/lib/Context/Python.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,15 @@ PyObject *_Py_XNewRef(PyObject *obj) {
2525
#define Py_XNewRef(obj) _Py_XNewRef((PyObject *)(obj))
2626
#endif
2727

28-
// bpo-40421 added PyFrame_GetCode() to Python 3.9.0b1
29-
#if PY_VERSION_HEX < 0x030900B1
30-
PyCodeObject *getFrameCodeObject(PyFrameObject *frame) {
31-
assert(frame != nullptr);
32-
assert(frame->f_code != nullptr);
33-
return (PyCodeObject *)(Py_NewRef(frame->f_code));
34-
}
35-
#else
3628
PyCodeObject *getFrameCodeObject(PyFrameObject *frame) {
3729
assert(frame != nullptr);
3830
return PyFrame_GetCode(frame);
3931
}
40-
#endif
4132

42-
// bpo-40421 added PyFrame_GetBack() to Python 3.9.0b1
43-
#if PY_VERSION_HEX < 0x030900B1
44-
PyFrameObject *getFrameBack(PyFrameObject *frame) {
45-
assert(frame != nullptr);
46-
return (PyFrameObject *)(Py_XNewRef(frame->f_back));
47-
}
48-
#else
4933
PyFrameObject *getFrameBack(PyFrameObject *frame) {
5034
assert(frame != nullptr);
5135
return PyFrame_GetBack(frame);
5236
}
53-
#endif
5437

5538
std::string unpackPyobject(PyObject *pyObject) {
5639
if (PyBytes_Check(pyObject)) {

0 commit comments

Comments
 (0)