Skip to content

Commit 543c2f5

Browse files
author
Shaw
committed
fix: preserve training venv in cpu smoke
1 parent 007b5b0 commit 543c2f5

2 files changed

Lines changed: 29 additions & 14 deletions

File tree

.github/workflows/training-stack.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ jobs:
7575
- name: Import probe — model_registry
7676
# The whole point of this lane: catch import-time errors in the
7777
# training package before they hit a real GPU run.
78+
# Mount live sources away from /workspace so the image's
79+
# /workspace/.venv remains visible at runtime.
7880
run: |
7981
docker run --rm \
80-
-v "${{ github.workspace }}/packages/training:/workspace" \
81-
-e PYTHONPATH=/workspace/scripts \
82+
-v "${{ github.workspace }}/packages/training:/workspace_src" \
83+
-e PYTHONPATH=/workspace_src/scripts \
8284
eliza-training-cpu:ci \
8385
-c "python -c 'from training.model_registry import REGISTRY; print(list(REGISTRY))'"
8486
@@ -87,11 +89,11 @@ jobs:
8789
# may be a no-op in some branches; we still surface its result.
8890
run: |
8991
docker run --rm \
90-
-v "${{ github.workspace }}/packages/training:/workspace" \
91-
-e PYTHONPATH=/workspace/scripts \
92+
-v "${{ github.workspace }}/packages/training:/workspace_src" \
93+
-e PYTHONPATH=/workspace_src/scripts \
9294
eliza-training-cpu:ci \
9395
-c "set -e; \
94-
cd /workspace; \
96+
cd /workspace_src; \
9597
pytest -xvs \
9698
scripts/test_default_thought_leak.py \
9799
scripts/test_eliza_record.py \
@@ -106,10 +108,10 @@ jobs:
106108
# COVERAGE_AUDIT.md) on every PR.
107109
run: |
108110
docker run --rm \
109-
-v "${{ github.workspace }}/packages/training:/workspace" \
110-
-e PYTHONPATH=/workspace/scripts \
111+
-v "${{ github.workspace }}/packages/training:/workspace_src" \
112+
-e PYTHONPATH=/workspace_src/scripts \
111113
eliza-training-cpu:ci \
112-
-c "set -e; cd /workspace; bash scripts/ci_smoke_e2e.sh"
114+
-c "set -e; cd /workspace_src; bash scripts/ci_smoke_e2e.sh"
113115
114116
- name: Upload logs on failure
115117
if: failure()

packages/training/scripts/training/__init__.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,29 @@
55
training pipeline (APOLLO, APOLLO-Mini, AdamW baseline).
66
"""
77

8-
from .optimizer import (
9-
build_adamw_optimizer,
10-
build_apollo_mini_optimizer,
11-
build_apollo_optimizer,
12-
optimizer_state_bytes,
13-
)
8+
from __future__ import annotations
9+
10+
from typing import TYPE_CHECKING, Any
11+
12+
if TYPE_CHECKING:
13+
from .optimizer import (
14+
build_adamw_optimizer,
15+
build_apollo_mini_optimizer,
16+
build_apollo_optimizer,
17+
optimizer_state_bytes,
18+
)
1419

1520
__all__ = [
1621
"build_adamw_optimizer",
1722
"build_apollo_mini_optimizer",
1823
"build_apollo_optimizer",
1924
"optimizer_state_bytes",
2025
]
26+
27+
28+
def __getattr__(name: str) -> Any:
29+
if name in __all__:
30+
from . import optimizer
31+
32+
return getattr(optimizer, name)
33+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

0 commit comments

Comments
 (0)