Skip to content

fix(15): current torch/peft, and pin the fine-tune GPU jobs (#31, step 5) - #44

Merged
corticalstack merged 3 commits into
mainfrom
feature/31-finetune-upgrade
Oct 7, 2026
Merged

corticalstack merged 3 commits into
mainfrom
feature/31-finetune-upgrade

Conversation

@corticalstack

Copy link
Copy Markdown
Owner

Summary

Step 5 of #31: the fine-tune lab (15) on current torch and peft, with the GPU jobs pinned so they stop changing under the lab.

  • Local fine-tune group: uv.lock moves torch 2.12.0 → 2.14.1 and peft 0.19.1 → 0.21.2. transformers stays at 4.53.3 because Phi-4-mini's remote code needs a release below 5.
  • The GPU jobs were broken on main. They ran on acpt-pytorch-2.2-cuda12.1:latest and installed accelerate, datasets, peft and olive-ai with no versions.
    • Microsoft rebuilt that image on 2026-09-29. Despite the repository name it now ships torch 2.13.0, CUDA 12.6 and Python 3.10.
    • On the rebuilt image, pip can't replace the image's own packages. The fine-tune job failed in pip install before training started: Permission denied: 'InputStream.py' while removing antlr4-python3-runtime 4.9.3 to make way for azure-cli.
  • What changed in the jobs:
    • The image is pinned to tag 58 instead of :latest.
    • accelerate, datasets and peft are pinned to the lock's versions and olive-ai to 0.13.0, so 15-04 loads the adapter with the versions that trained it.
    • The packages install into a venv created with --system-site-packages, so they use the image's torch without pip having to remove anything from the image.
  • 15-02 and 15-03 now raise when their GPU job fails. Before, they printed the failure or fell back to 0% accuracy, and passed.

Type of change

  • Bug fix (notebook, Bicep, or doc)
  • New lab or sub-lab
  • Extension to an existing lab
  • Documentation / README / CONTRIBUTING update
  • CI / tooling

Checklist

  • On a feature branch (not main)
  • Notebook(s) run top-to-bottom on a clean kernel (15-01 to 15-04; see below for 15-02 and 15-03)
  • uv sync succeeds with no new heavyweight deps without justification
  • New env vars added to .env.example with placeholders (none)
  • Lab added (or updated) in the index table of README.md (no change)
  • No secrets in committed files (.env, keys, connection strings)
  • Screenshots placed under docs/screenshots/ (none)

Verification

Notebook Where Result
15-01 Local + APIM teacher PASS, 124 s, on torch 2.14.1
15-02 A100 serverless GPU PASS, 1210 s. The job installs the pins, Olive trains 300 LoRA steps on gpu-cuda, and the adapter (369 MB) is uploaded
15-03 A100 serverless GPU PASS, 660 s. Accuracy is 65.7% (23/35) (the lab doc's last recorded result was 51.4%), with a SEVERITY: line in every response
15-04 Local CPU PASS, 134 s. peft 0.21.2 loads the new adapter on torch 2.14.1 and classifies 2013-05-09 (the 2B PVTCS ammonia leak) as expected
  • Region: swedencentral had no capacity (ManagedEnvironmentCapacityHeavyUsageError), so 15-02 and 15-03 ran against an A100 environment in italynorth. I used throwaway copies that changed only LOCATION and the environment name. The lab's code still targets swedencentral.
  • Offline checks before the GPU run:
    • The pinned set resolves against the image's torch 2.13.0 and numpy 1.26.4.
    • Every olive finetune option the job passes exists in olive 0.13.0.
    • check_imports.py passes.

The 15-02 comment "ACA GPU NC24-A100 only available in Sweden Central" is out of date. A100 serverless GPU is now also in westus3, westus, eastus, canadacentral, italynorth, uksouth and australiaeast. I left it for a separate change.

Related issues

Refs #31

The finetune group's floors (torch>=2.0.0, peft>=0.10.0) already allow
the current releases; only the lock held them back. `uv lock
--upgrade-package torch --upgrade-package peft` moves torch 2.12.0 ->
2.14.1 (with triton 3.8.0 and its CUDA 13 wheels) and peft 0.19.1 ->
0.21.2. transformers stays at 4.53.3 for Phi-4-mini's remote code.

15-01 passes against Azure on the new torch, and 15-04 loads a LoRA
adapter trained with peft 0.21.2 and classifies a report on CPU.
Refs #31.
The ACA fine-tune and evaluation jobs ran on
acpt-pytorch-2.2-cuda12.1:latest and pip-installed accelerate, datasets,
peft and olive-ai unpinned, so every run got whatever was newest.
Microsoft rebuilt that image on 2026-09-29: despite the repository name
it now ships torch 2.13.0, CUDA 12.6 and Python 3.10, and pip can no
longer replace its packages. The fine-tune job failed in pip install
("Permission denied: 'InputStream.py'" while removing
antlr4-python3-runtime 4.9.3 for azure-cli) before training started.

- Pin the image to tag 58 instead of :latest.
- Pin accelerate 1.15.0, datasets 5.0.1 and peft 0.21.2 to the lock and
  olive-ai[auto-opt] to 0.13.0, so 15-04 loads the adapter with the
  versions that trained it.
- Install them into a venv created with --system-site-packages. It sees
  the image's torch but never needs to remove the image's own packages.

Verified on the A100 serverless GPU (in italynorth; swedencentral had no
capacity): the fine-tune job installs, trains 300 steps and uploads the
adapter (18 min), and the evaluation job scores 65.7% (23/35) with a
SEVERITY line in every response. Refs #31.
15-02 printed "Training failed" and 15-03 fell back to 0% accuracy when
the ACA job failed, so both notebooks passed. A headless run of 15-02
reported PASS while the fine-tune job had failed in pip install. Both
now raise instead. Refs #31.
@corticalstack
corticalstack merged commit f6f732f into main Oct 7, 2026
10 checks passed
@corticalstack
corticalstack deleted the feature/31-finetune-upgrade branch October 7, 2026 14:02
@corticalstack corticalstack mentioned this pull request Oct 7, 2026
8 of 12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant