Skip to content

Commit cd5b36f

Browse files
fix(ci): use writable unit test caches
Signed-off-by: svcnemo-autobot <svcnemo-autobot@nvidia.com>
1 parent 7b58669 commit cd5b36f

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎.github/actions/test-template/action.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,12 @@ runs:
114114
echo "::group::Start test container"
115115
if [[ "$MOUNT_FS" == "true" ]]; then
116116
VOLUME_ARGS="--volume ${{ inputs.test-data-path }}:/home/TestData --env HF_HUB_OFFLINE=1"
117+
HF_HOME=/home/TestData/HF_HOME
118+
NEMO_HOME=/home/TestData/nemo_home
117119
else
118120
VOLUME_ARGS=""
121+
HF_HOME=/home/ubuntu/.cache/huggingface
122+
NEMO_HOME=/home/ubuntu/.cache/nemo
119123
fi
120124
121125
cmd=$(cat <<RUN_TEST_EOF
@@ -131,8 +135,8 @@ runs:
131135
--cpus=40 \
132136
--env GHA_RUNNER=${{ inputs.runner }} \
133137
--env HYDRA_FULL_ERROR=1 \
134-
--env HF_HOME=/home/TestData/HF_HOME \
135-
--env NEMO_HOME=/home/TestData/nemo_home \
138+
--env HF_HOME=$HF_HOME \
139+
--env NEMO_HOME=$NEMO_HOME \
136140
--env RUN_ID=${{ github.run_id }} \
137141
--env UV_NO_SYNC=1 \
138142
--workdir /opt/Megatron-Bridge \

‎.github/scripts/test_docker_dependency_layers.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ if grep -qE 'mcore_(commit|ref)|MCORE_COMMIT|uv sync --all-extras --all-groups'
243243
echo "Test template must use the already-validated MCore in the built image" >&2
244244
exit 1
245245
fi
246+
grep -Fq 'VOLUME_ARGS="--volume ${{ inputs.test-data-path }}:/home/TestData --env HF_HUB_OFFLINE=1"' "$composite_action"
247+
grep -q 'MOUNT_FS: ${{ inputs.is_unit_test == '\''false'\'' }}' "$composite_action"
248+
grep -q 'HF_HOME=/home/TestData/HF_HOME' "$composite_action"
249+
grep -q 'NEMO_HOME=/home/TestData/nemo_home' "$composite_action"
250+
grep -q 'HF_HOME=/home/ubuntu/.cache/huggingface' "$composite_action"
251+
grep -q 'NEMO_HOME=/home/ubuntu/.cache/nemo' "$composite_action"
246252

247253
# The baseline dependency layer must be structurally independent of the mutable
248254
# dispatched checkout. CI validates the ordering statically so this regression

‎src/megatron/bridge/training/gpt_step.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ def _patch_mcore_schedule_plan_padding_mask() -> None:
131131
TODO: Remove this compatibility patch after MCore dev's schedule-plan
132132
padding-mask forwarding reaches the pinned main commit.
133133
"""
134-
from megatron.core.models.common import fine_grained_callables
134+
try:
135+
from megatron.core.models.common import fine_grained_callables
136+
except ImportError:
137+
from megatron.core.models.gpt import fine_grained_callables
135138

136139
current_builder = fine_grained_callables.build_transformer_layer_callables
137140
if getattr(current_builder, _MCORE_SCHEDULE_PADDING_MASK_PATCHED, False):

0 commit comments

Comments
 (0)