Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docker/rocm.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,13 @@ RUN cd aiter \
&& echo "[AITER] GPU_ARCH=${GPU_ARCH}" \
&& sed -i '/c1 = torch.empty((M, D, S1 + S3), dtype=dtype, device=x.device)/i\ config = dict(config)' aiter/ops/triton/gemm/fused/fused_gemm_afp4wfp4_split_cat.py \
&& if [ "$BUILD_AITER_ALL" = "1" ] && [ "$BUILD_LLVM" = "1" ]; then \
sh -c "HIP_CLANG_PATH=/sgl-workspace/llvm-project/build/bin/ PREBUILD_KERNELS=1 GPU_ARCHS=$GPU_ARCH_LIST python setup.py develop"; \
sh -c "HIP_CLANG_PATH=/sgl-workspace/llvm-project/build/bin/ PREBUILD_KERNELS=1 GPU_ARCHS=$GPU_ARCH_LIST python setup.py build_ext --inplace" \
&& sh -c "HIP_CLANG_PATH=/sgl-workspace/llvm-project/build/bin/ GPU_ARCHS=$GPU_ARCH_LIST pip install -e ."; \
Comment on lines +204 to +205
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and efficiency, you can combine these two sh -c calls into a single one. This avoids spawning a new shell for each command and keeps the related logic together. By using export, the environment variables are set for all subsequent commands within the same shell.

          sh -c "export HIP_CLANG_PATH=/sgl-workspace/llvm-project/build/bin/; export GPU_ARCHS=$GPU_ARCH_LIST; PREBUILD_KERNELS=1 python setup.py build_ext --inplace && pip install -e ."; \

elif [ "$BUILD_AITER_ALL" = "1" ]; then \
sh -c "PREBUILD_KERNELS=1 GPU_ARCHS=$GPU_ARCH_LIST python setup.py develop"; \
sh -c "PREBUILD_KERNELS=1 GPU_ARCHS=$GPU_ARCH_LIST python setup.py build_ext --inplace" \
&& sh -c "GPU_ARCHS=$GPU_ARCH_LIST pip install -e ."; \
Comment on lines +207 to +208
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similarly to the above, you can combine these two sh -c calls into a single one for better readability and efficiency.

          sh -c "export GPU_ARCHS=$GPU_ARCH_LIST; PREBUILD_KERNELS=1 python setup.py build_ext --inplace && pip install -e ."; \

else \
sh -c "GPU_ARCHS=$GPU_ARCH_LIST python setup.py develop"; \
sh -c "GPU_ARCHS=$GPU_ARCH_LIST pip install -e ."; \
fi \
&& echo "export PYTHONPATH=/sgl-workspace/aiter:\${PYTHONPATH}" >> /etc/bash.bashrc

Expand Down
Loading