Skip to content

Commit e35bf56

Browse files
thuyenfacebook-github-bot
authored andcommitted
[Bazel] Add CUDA build to CI (pytorch#66241)
Summary: Fixes pytorch#35316 On master, bazel cuda build is disabled due to lack of a proper `cu_library` rule. This PR: - Add `rules_cuda` to the WORKSPACE and forward `cu_library` to `rules_cuda`. - Use a simple local cuda and cudnn repositories (adopted from TRTorch) for cuda 11.3. - Fix current broken cuda build. - Enable cuda build in CI, not just for `:torch` target but all the test binaries to catch undefined symbols. Pull Request resolved: pytorch#66241 Reviewed By: ejguan Differential Revision: D31544091 Pulled By: malfet fbshipit-source-id: fd3c34d0e8f80fee06f015694a4c13a8e9e12206
1 parent e0f4e28 commit e35bf56

17 files changed

+765
-826
lines changed

.bazelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
build --copt=--std=c++14
22
build --copt=-I.
33
build --copt=-isystem --copt bazel-out/k8-fastbuild/bin
4+
build --experimental_ui_max_stdouterr_bytes=2048576
45

56
# Configuration to disable tty features for environments like CI
67
build:no-tty --curses no
@@ -11,3 +12,8 @@ build:no-tty --show_progress_rate_limit 10
1112
build:gpu --define=cuda=true
1213
# define a separate build folder for faster switching between configs
1314
build:gpu --platform_suffix=-gpu
15+
# rules_cuda configuration
16+
build:gpu --@rules_cuda//cuda:enable_cuda
17+
build:gpu --@rules_cuda//cuda:cuda_targets=sm_52
18+
build:gpu --@rules_cuda//cuda:compiler=nvcc
19+
build:gpu --repo_env=CUDA_PATH=/usr/local/cuda

.github/generated-ciflow-ruleset.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/scripts/generate_ci_workflows.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ def generate_workflow_file(self, workflow_template: jinja2.Template) -> None:
609609
BAZEL_WORKFLOWS = [
610610
CIWorkflow(
611611
arch="linux",
612-
build_environment="linux-xenial-py3.6-gcc7-bazel-test",
613-
docker_image_base=f"{DOCKER_REGISTRY}/pytorch/pytorch-linux-bionic-cuda10.2-cudnn7-py3.9-gcc7",
612+
build_environment="linux-xenial-cuda11.3-py3.6-gcc7-bazel-test",
613+
docker_image_base=f"{DOCKER_REGISTRY}/pytorch/pytorch-linux-xenial-cuda11.3-cudnn8-py3-gcc7",
614614
test_runner_type=LINUX_CPU_TEST_RUNNER,
615615
ciflow_config=CIFlowConfig(
616616
labels={LABEL_CIFLOW_DEFAULT, LABEL_CIFLOW_BAZEL, LABEL_CIFLOW_CPU, LABEL_CIFLOW_LINUX},

0 commit comments

Comments
 (0)