Open cduk opened 4 months ago
It's clearly not, since it's downloaded triton==3.0.0
, which is not published in this repository (but is published on PyPI).
Can you try pip3 install --index-url https://sasha0552.github.io/vllm-ci/ --force-reinstall --no-deps triton
? Also make sure it downloads triton==2.3.0
from github.com (if I remember correctly, it prints the URL when installing not from PyPI.)
As for "test if patch applied successfully" - the main indicator is that the following code does not cause a crash:
import torch
import triton
import triton.language as tl
@triton.jit
def test_max_kernel():
t = tl.zeros([2, 2], dtype=tl.float32)
m = tl.max(t, 1)
tl.device_print("max:", m)
@triton.jit
def test_sum_kernel():
t = tl.zeros([2, 2], dtype=tl.float32)
s = tl.sum(t, 1)
tl.device_print("sum:", s)
if True:
grid = lambda meta: (1, )
kernel = test_max_kernel[grid]()
if True:
grid = lambda meta: (1, )
kernel = test_sum_kernel[grid]()
Thanks a lot! It looks like it worked! I will try to add the command to vLLM docker file so it automatically fixes it.
# python3 -m pip install --index-url https://sasha0552.github.io/vllm-ci/ --force-reinstall --no-deps triton
Looking in indexes: https://sasha0552.github.io/vllm-ci/
Collecting triton
Downloading https://github.com/sasha0552/vllm-ci/releases/download/v10/triton-2.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (168.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 168.1/168.1 MB 16.4 MB/s eta 0:00:00
Installing collected packages: triton
Attempting uninstall: triton
Found existing installation: triton 3.0.0
Uninstalling triton-3.0.0:
Successfully uninstalled triton-3.0.0
Successfully installed triton-2.3.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@b5774f219676:/vllm-workspace#
# python3 tritontest
pid (0, 0, 0) idx (0) max: 0.000000
pid (0, 0, 0) idx (1) max: 0.000000
pid (0, 0, 0) idx (0) max: 0.000000
pid (0, 0, 0) idx (1) max: 0.000000
pid (0, 0, 0) idx (0) max: 0.000000
...
pid (0, 0, 0) idx (1) sum: 0.000000
pid (0, 0, 0) idx (0) sum: 0.000000
pid (0, 0, 0) idx (1) sum: 0.000000
I try to apply the triton patch like this:
pip3 install --extra-index-url https://sasha0552.github.io/vllm-ci/ --force-reinstall triton
Which shows
So it managed to re-install, but it went suspiciously quickly and there's no indication whether the patches are applied or not. Is there a way to test this?