Skip to content

Commit a130026

Browse files
xuzhao9facebook-github-bot
authored andcommitted
fix fbgemm (#222)
Summary: FBGEMM changed the installation command for genai variant: https://docs.pytorch.org/FBGEMM/fbgemm_genai/development/BuildInstructions.html#cuda-build Pull Request resolved: #222 Test Plan: https://github.com/pytorch-labs/tritonbench/actions/runs/14963093343 Reviewed By: njriasan Differential Revision: D74528038 Pulled By: xuzhao9 fbshipit-source-id: 2e6982b0247e28b60d86d6f38785651fcb8f8f3b
1 parent d835d3d commit a130026

File tree

4 files changed

+71
-9
lines changed

4 files changed

+71
-9
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
benchmarks:
2-
- benchmark_name: bf16_ragged_attention_fwd
1+
bf16_ragged_attention_fwd:
2+
op: ragged_attention
33
args: --op ragged_attention --only hstu --num-inputs 1 --input-id 2 --metrics tflops --cudagraph --simple-output
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# default base image: ghcr.io/actions/actions-runner:latest
2+
# base image: Ubuntu 22.04 jammy
3+
# Prune CUDA to only keep gencode >= A100
4+
ARG BASE_IMAGE=ghcr.io/actions/actions-runner:latest
5+
FROM ${BASE_IMAGE}
6+
7+
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
8+
ARG OVERRIDE_GENCODE="-gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90a,code=sm_90a"
9+
ARG OVERRIDE_GENCODE_CUDNN="-gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90a,code=sm_90a"
10+
11+
RUN sudo apt-get -y update && sudo apt -y update
12+
# fontconfig: required by model doctr_det_predictor
13+
# libjpeg and libpng: optionally required by torchvision (vision#8342)
14+
RUN sudo apt-get install -y git jq gcc g++ \
15+
vim wget curl ninja-build cmake \
16+
libgl1-mesa-glx libsndfile1-dev kmod libxml2-dev libxslt1-dev \
17+
fontconfig libfontconfig1-dev \
18+
libpango-1.0-0 libpangoft2-1.0-0 \
19+
libsdl2-dev libsdl2-2.0-0 \
20+
libjpeg-dev libpng-dev zlib1g-dev
21+
22+
# get switch-cuda utility
23+
RUN sudo wget -q https://raw.githubusercontent.com/phohenecker/switch-cuda/master/switch-cuda.sh -O /usr/bin/switch-cuda.sh
24+
RUN sudo chmod +x /usr/bin/switch-cuda.sh
25+
26+
RUN sudo mkdir -p /workspace; sudo chown runner:runner /workspace
27+
28+
# GKE version: 1.28.5-gke.1217000
29+
# NVIDIA driver version: 535.104.05
30+
# NVIDIA drivers list available at gs://ubuntu_nvidia_packages/
31+
# We assume that the host NVIDIA driver binaries and libraries are mapped to the docker filesystem
32+
33+
# Install CUDA 12.8 build toolchains
34+
RUN cd /workspace; mkdir -p pytorch-ci; cd pytorch-ci; wget https://raw.githubusercontent.com/pytorch/pytorch/main/.ci/docker/common/install_cuda.sh
35+
RUN cd /workspace/pytorch-ci; wget https://raw.githubusercontent.com/pytorch/pytorch/main/.ci/docker/common/install_cudnn.sh && \
36+
wget https://raw.githubusercontent.com/pytorch/pytorch/main/.ci/docker/common/install_nccl.sh && \
37+
wget https://raw.githubusercontent.com/pytorch/pytorch/main/.ci/docker/common/install_cusparselt.sh && \
38+
mkdir ci_commit_pins && cd ci_commit_pins && \
39+
wget https://raw.githubusercontent.com/pytorch/pytorch/main/.ci/docker/ci_commit_pins/nccl-cu12.txt
40+
RUN sudo bash -c "set -x;export OVERRIDE_GENCODE=\"${OVERRIDE_GENCODE}\" OVERRIDE_GENCODE_CUDNN=\"${OVERRIDE_GENCODE_CUDNN}\"; cd /workspace/pytorch-ci; bash install_cuda.sh 12.8"
41+
42+
# Install miniconda
43+
RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /workspace/Miniconda3-latest-Linux-x86_64.sh
44+
RUN cd /workspace && \
45+
chmod +x Miniconda3-latest-Linux-x86_64.sh && \
46+
bash ./Miniconda3-latest-Linux-x86_64.sh -b -u -p /workspace/miniconda3
47+
48+
# Test activate miniconda
49+
RUN . /workspace/miniconda3/etc/profile.d/conda.sh && \
50+
conda activate base && \
51+
conda init
52+
53+
RUN echo "\
54+
. /workspace/miniconda3/etc/profile.d/conda.sh\n\
55+
conda activate base\n\
56+
export CONDA_HOME=/workspace/miniconda3\n\
57+
export CUDA_HOME=/usr/local/cuda\n\
58+
export PATH=/home/runner/bin\${PATH:+:\${PATH}}\n\
59+
export LD_LIBRARY_PATH=\${CUDA_HOME}/lib64\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}\n\
60+
export LIBRARY_PATH=\${CUDA_HOME}/lib64\${LIBRARY_PATHPATH:+:\${LIBRARY_PATHPATH}}\n" >> /workspace/setup_instance.sh
61+
62+
RUN echo ". /workspace/setup_instance.sh\n" >> ${HOME}/.bashrc

install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ def install_fbgemm(genai=True):
6262
sys.executable,
6363
"setup.py",
6464
"install",
65-
"--package_variant=genai",
65+
"--build-target=genai",
6666
"-DTORCH_CUDA_ARCH_LIST=8.0;9.0;9.0a",
6767
]
6868
else:
6969
cmd = [
7070
sys.executable,
7171
"setup.py",
7272
"install",
73-
"--package_variant=cuda",
73+
"--build-target=cuda",
7474
"-DTORCH_CUDA_ARCH_LIST=8.0;9.0;9.0a",
7575
]
7676
subprocess.check_call(cmd, cwd=str(FBGEMM_PATH.resolve()))

tritonbench/utils/run_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ def run_config(config_file: str):
9191
assert Path(config_file).exists(), f"Config file {config_file} must exist."
9292
with open(config_file, "r") as fp:
9393
config = yaml.safe_load(fp)
94-
benchmarks = config["benchmarks"]
95-
for benchmark in benchmarks:
96-
op_args = benchmark["args"].split(" ")
97-
benchmark_name = benchmark["benchmark_name"]
98-
run_in_task(op=None, op_args=op_args, benchmark_name=benchmark_name)
94+
for benchmark_name in config:
95+
benchmark_config = config[benchmark_name]
96+
op_name = benchmark_config["op"]
97+
op_args = benchmark_config["args"].split(" ")
98+
run_in_task(op=op_name, op_args=op_args, benchmark_name=benchmark_name)
9999

100100

101101
def run_in_task(

0 commit comments

Comments
 (0)