Skip to content

Commit 89f5e40

Browse files
committed
Add fbgemm genai to the nightly docker
1 parent cfa3f7c commit 89f5e40

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

docker/gcp-a100-runner-dind.dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ RUN sudo mkdir -p /workspace; sudo chown runner:runner /workspace
2828
# We assume that the host NVIDIA driver binaries and libraries are mapped to the docker filesystem
2929

3030
# Use the CUDA installation scripts from pytorch/builder
31+
# Install CUDA 12.4 only to reduce docker size
3132
RUN cd /workspace; git clone https://github.com/pytorch/builder.git
32-
RUN sudo bash -c 'source /workspace/builder/common/install_cuda.sh; install_118; prune_118'
33-
RUN sudo bash -c 'source /workspace/builder/common/install_cuda.sh; install_121; prune_121'
33+
RUN sudo bash -c 'source /workspace/builder/common/install_cuda.sh; install_124; prune_124'
3434

3535
# Install miniconda
3636
RUN wget -q https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /workspace/Miniconda3-latest-Linux-x86_64.sh

docker/torchbench-nightly.dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,8 @@ RUN cd /workspace/benchmark && \
4848
RUN cd /workspace/benchmark && \
4949
. ${SETUP_SCRIPT} && \
5050
python install.py
51+
52+
# Install FBGEMM GENAI
53+
RUN cd /workspace/benchmark && \
54+
. ${SETUP_SCRIPT} && \
55+
python install.py --userbenchmark triton --fbgemm

install.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def pip_install_requirements(requirements_txt="requirements.txt"):
4646
choices=list_userbenchmarks(),
4747
help="Install requirements for optional components.",
4848
)
49-
args = parser.parse_args()
49+
args, extra_args = parser.parse_known_args()
5050

5151
os.chdir(os.path.realpath(os.path.dirname(__file__)))
5252

@@ -68,9 +68,11 @@ def pip_install_requirements(requirements_txt="requirements.txt"):
6868
if args.userbenchmark:
6969
# Install userbenchmark dependencies if exists
7070
userbenchmark_dir = REPO_ROOT.joinpath("userbenchmark", args.userbenchmark)
71+
cmd = [sys.executable, "install.py"]
72+
cmd.extend(extra_args)
7173
if userbenchmark_dir.joinpath("install.py").is_file():
7274
subprocess.check_call(
73-
[sys.executable, "install.py"], cwd=userbenchmark_dir.absolute()
75+
cmd, cwd=userbenchmark_dir.absolute()
7476
)
7577
sys.exit(0)
7678

userbenchmark/triton/install.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import argparse
2+
import subprocess
3+
import sys
4+
5+
from torchbenchmark import REPO_PATH
6+
FBGEMM_PATH = REPO_PATH.joinpath("submodules", "FBGEMM", "fbgemm_gpu")
7+
8+
def install_fbgemm():
9+
cmd = [sys.executable, "setup.py", "bdist_wheel", "--package_variant=genai"]
10+
subprocess.check_call(cmd, cwd=FBGEMM_PATH)
11+
12+
def test_fbgemm():
13+
cmd = [sys.executable, "-c", '"import fbgemm_gpu.experimental.gen_ai"']
14+
subprocess.check_call(cmd)
15+
16+
if __name__ == "__main__":
17+
parser = argparse.ArgumentParser()
18+
parser.add_argument("--fbgemm", action="store_true", help="Install FBGEMM GPU")
19+
args = parser.parse_args()
20+
if args.fbgemm:
21+
install_fbgemm()
22+
test_fbgemm()

0 commit comments

Comments
 (0)