Skip to content

Commit fffbb21

Browse files
committed
[Draft] Fix blogpost code
1 parent 2fa50b7 commit fffbb21

12 files changed

Lines changed: 3878 additions & 38 deletions

File tree

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.direnv

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.direnv/
22
.pre-commit-config.yaml
3-
MODULE.bazel.lock
43
bazel-*
54
compile_commands.json
65
lre.bazelrc

finetuning_on_cpu/.bazelrc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Pick up system specific configs.
2+
common --enable_platform_specific_config
3+
4+
# Don't inherit PATH and LD_LIBRARY_PATH.
5+
build --incompatible_strict_action_env
6+
7+
# Forbid network access unless explicitly enabled.
8+
build --sandbox_default_allow_network=false
9+
10+
# Use correct runfile locations.
11+
build --nolegacy_external_runfiles
12+
13+
# Enable sandboxing for exclusive tests like GPU performance tests.
14+
test --incompatible_exclusive_test_sandboxed
15+
16+
# Simulate rules_python's initialization with a script and use a statically
17+
# linked musl Python toolchain.
18+
common --@rules_python//python/config_settings:bootstrap_impl=script
19+
common --@rules_python//python/config_settings:py_linux_libc=musl
20+
# common --@rules_python//python/config_settings:pip_whl_muslc_version=3.13
21+
22+
# Remote optimizations.
23+
build --remote_download_minimal
24+
25+
# Smaller profiling. Careful. Disabling this might explode remote cache usage.
26+
build --slim_profile
27+
build --experimental_profile_include_target_label
28+
build --noexperimental_profile_include_primary_output
29+
30+
# Use the container image specified in `platforms/BUILD.bazel`.
31+
build --extra_execution_platforms=@//platforms:python-remote
32+
build --extra_toolchains=@zig_sdk//toolchain:linux_amd64_musl
33+
34+
# Add user specific flags.
35+
try-import %workspace%/user.bazelrc

finetuning_on_cpu/.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.2.1

finetuning_on_cpu/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ bazel-finetune-repo
33
bazel-out
44
bazel-bin
55
bazel-testlogs
6-
.bazelrc
76
.env
8-
MODULE.bazel.lock

finetuning_on_cpu/MODULE.bazel

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
bazel_dep(name = "hermetic_cc_toolchain", version = "4.0.0")
2+
bazel_dep(name = "platforms", version = "0.0.11")
3+
bazel_dep(name = "rules_cc", version = "0.1.1")
14
bazel_dep(name = "rules_python", version = "1.2.0")
25
bazel_dep(name = "rules_shell", version = "0.4.1")
36

7+
# Used internally by rules_python.
8+
cc_toolchains = use_extension("@hermetic_cc_toolchain//toolchain:ext.bzl", "toolchains")
9+
use_repo(cc_toolchains, "zig_sdk")
10+
11+
# Python configuration
412
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
5-
python.toolchain(
6-
python_version = "3.13",
7-
)
13+
python.toolchain(python_version = "3.13")
814

15+
# Python packages
916
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
1017
pip.parse(
1118
hub_name = "pypi",
1219
python_version = "3.13",
1320
requirements_lock = "//:bazel_requirements_lock.txt",
1421
)
15-
1622
use_repo(pip, "pypi")

finetuning_on_cpu/MODULE.bazel.lock

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

finetuning_on_cpu/bazel_requirements_lock.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,19 @@ python-dotenv==1.1.0
155155
# for loading env variables
156156
scipy==1.15.2
157157
# for torch to get embeddings
158+
159+
# Manual adjusted below.
160+
nvidia-cublas-cu12==12.9.0.13
161+
nvidia-cuda-cupti-cu12==12.9.19
162+
nvidia-cuda-nvrtc-cu12==12.9.41
163+
nvidia-cuda-runtime-cu12==12.9.37
164+
nvidia-cudnn-cu12==9.10.0.56
165+
nvidia-cufft-cu12==11.4.0.6
166+
nvidia-curand-cu12==10.3.10.19
167+
nvidia-cusolver-cu12==11.7.4.40
168+
nvidia-cusparse-cu12==12.5.9.5
169+
nvidia-cusparselt-cu12==0.7.1
170+
nvidia-nccl-cu12==2.26.5
171+
nvidia-nvjitlink-cu12==12.9.41
172+
nvidia-nvtx-cu12==12.9.19
173+
triton==3.3.0
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
platform(
2+
name = "python-remote",
3+
constraint_values = [
4+
"@platforms//os:linux",
5+
"@platforms//cpu:x86_64",
6+
],
7+
exec_properties = {
8+
"OSFamily": "Linux",
9+
"ISA": "x86-64",
10+
"container-image": "docker.io/evaanahmed2001/python-bazel-env@sha256:8de13199d587964b218c0b671272b42031cf4944b2f426e6eee7d7542802bf7c",
11+
},
12+
)

0 commit comments

Comments
 (0)