Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@ corpora/posix-api/ export-ignore
# headers. Provenance first, then it can ship.
corpora/musl-headers/ export-ignore

# Build and download logs from one pod run. Evidence worth keeping, not source
# anyone needs to clone.
pod-artifacts-qwen3coder/ export-ignore
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
# Poids de modèles — plusieurs dizaines de Go, jamais dans git.
# ─────────────────────────────────────────────────────────────────────────
/models/
# Served GGUFs. The first name is the directory this deployment still has
# on disk (47 GB): renaming the RULE without moving the DIRECTORY is how
# 47 GB becomes visible to `git add -A`. The second is where the server
# layout puts them.
/edgem-gguf/
# Served GGUFs, where the server layout puts them.
/models/gguf/

# ─────────────────────────────────────────────────────────────────────────
Expand Down
38 changes: 15 additions & 23 deletions client/TRAINING_DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ real store. Run `python -m training freeze --source audit/training-data
semantic OpenAI messages, source checksums, policies, governance, a held-out
evaluation plan, Axolotl configuration, and a human runbook.

The default source is the Transformers checkpoint
`Qwen/Qwen3-Coder-Next`, not the deployed GGUF inference artifact. The optional
`qwen3_coder_next_base` profile uses `Qwen/Qwen3-Coder-Next-Base`. GGUF paths
are rejected. The initial profile is conservative 4-bit QLoRA and targets only
attention projections; targeting MoE experts is explicit because it changes
memory requirements.
The source is the Transformers checkpoint `Qwen/Qwen3.8-27B` (profile
`qwen38_27b_sft`), at the revision the operator pins in
`training-execution.json` (the weights were fetched at
`8c0b3d30f3ae96f5c7f774de704bf0ada83e422a`), not the deployed GGUF;
GGUF paths are rejected. The profile is conservative 4-bit QLoRA and targets
only attention projections.

Every SFT message is annotated with a per-turn `train` flag. Context—including
prior failed assistant actions—is false; only FT1's selected last assistant
Expand Down Expand Up @@ -124,11 +124,8 @@ and missing source revision remain hard gates.
The expected environment is a dedicated operator-managed Python/Axolotl
environment, separate from the inference service on port 8010. Current
Axolotl guidance requires Python >=3.11, PyTorch >=2.11, and an NVIDIA Ampere+
or AMD GPU. Its Qwen3-Next guide describes conservative QLoRA at about 47 GiB
without expert targeting and about 71 GiB with expert targeting; these are
coarse planning values, not an EDGEM admission formula. Axolotl's documented
uv installation and Qwen3-Next extra dependencies are not installed
automatically.
or AMD GPU. Axolotl's documented uv installation and optional dependencies
are not installed automatically.

If SSH authentication is unavailable, configure the normal OpenSSH alias so
`ssh <training-host>` succeeds non-interactively from the SPEAR account. Use an
Expand All @@ -147,18 +144,13 @@ UUID and cache paths before executing Axolotl.
The pinned environment currently contains Axolotl 0.18.0, PyTorch 2.12.1+cu130,
Transformers 5.14.1, PEFT 0.19.1, bitsandbytes 0.49.1,
flash-linear-attention 0.4.1, and Cut Cross Entropy 25.1.1. The source model is
`Qwen/Qwen3-Coder-Next` at immutable revision
`a7fbcb5c0e12d62a448eaa0e260346bf5dcc0feb`; only tokenizer/config/chat-template
assets were fetched, never model weights.

The assigned RTX PRO 6000 Blackwell has 97,887 MiB total VRAM, so hardware
capacity is `READY` for the coarse approximately 47 GiB no-expert QLoRA
profile. Current availability is `BUSY` because the known llama-server uses
82,628 MiB and 14,599 MiB is free. FT4C never stops or signals inference.
These are separate from data readiness, which remains `COLLECTING` with zero
real episodes. The bounded synthetic Axolotl preprocess succeeded and showed
50 ignored labels plus 5 trainable labels, preserving one-target masking;
`axolotl train` was never executed.
`Qwen/Qwen3.8-27B` at revision `8c0b3d30f3ae96f5c7f774de704bf0ada83e422a`.

The assigned RTX PRO 6000 Blackwell has 97,887 MiB total VRAM. A training
job never stops or signals inference on its own: the controlled handoff below
does, for a job that owns the GPU lease. The bounded synthetic Axolotl
preprocess showed 50 ignored labels plus 5 trainable labels, preserving
one-target masking; `axolotl train` was never executed.

## Controlled inference handoff (FT4D)

Expand Down
2 changes: 1 addition & 1 deletion client/cli/finetune_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _format_doctor(local: LocalDoctorReport,
"source_model_revision", "environment_fingerprint",
"axolotl_available",
"axolotl_version", "package", "disk_available_kib",
"training_root", "qwen3_next_compatibility"):
"training_root"):
if key in checks:
value = checks[key]

Expand Down
8 changes: 3 additions & 5 deletions client/cli/model_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,9 @@ def chat_once(client, messages, use_tools=True, spinner=None):
# --served-model-name, so make it configurable (SPEAR_MODEL_NAME).
model=os.environ.get("SPEAR_MODEL_NAME", "qwen3"),
messages=messages,
# Sampling temperature (SPEAR_TEMP). 0.25 gives more conservative,
# consistent edits on Qwen3-Coder-Next (less prone to over-eager
# refactors like dropping includes). NOTE: on the older dense/A3B model
# a low temp starved the sampler into repetition loops; if that recurs,
# raise SPEAR_TEMP back toward 0.7.
# Sampling temperature (SPEAR_TEMP). A low value gives conservative,
# consistent edits; if it starves the sampler into repetition loops,
# raise SPEAR_TEMP toward 0.7.
temperature=float(os.environ.get("SPEAR_TEMP", "0.25")),
top_p=0.8,
# Big enough that a full file rewrite (write_file with the whole new
Expand Down
52 changes: 19 additions & 33 deletions client/doc/source/training_host_setup.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
SPEAR training host setup
============================

This is an operator runbook for a future ``<training-host>`` Qwen3-Coder-Next
experiment. FT4B diagnostics found that the current SPEAR execution account
This is an operator runbook for a ``<training-host>`` Qwen3.8-27B fine-tune. FT4B diagnostics found that the current SPEAR execution account
cannot authenticate through the bare ``<training-host>`` target, while the explicit
operator destination/identity works. No setup command below has been executed by
SPEAR. Do not use these instructions to modify the inference service or its
Expand Down Expand Up @@ -32,21 +31,13 @@ environment's Axolotl binary.

Installed versions are Axolotl 0.18.0, PyTorch 2.12.1+cu130, Transformers
5.14.1, PEFT 0.19.1, bitsandbytes 0.49.1, flash-linear-attention 0.4.1, and
Cut Cross Entropy 25.1.1. Tokenizer/config/chat-template-only assets for
``Qwen/Qwen3-Coder-Next`` were downloaded at revision
``a7fbcb5c0e12d62a448eaa0e260346bf5dcc0feb``; no model weights were fetched.

Capacity and availability are separate: the assigned GPU has 97,887 MiB total
(suitable for the approximately 47 GiB no-expert QLoRA reference profile), but
14,599 MiB free while the existing llama-server uses 82,628 MiB. Current
availability is therefore ``BUSY``; FT4C does not stop or signal that workload.
Future operator-controlled training may stop the known inference service and
re-check free VRAM before launch.

The training filesystem currently has roughly 100,937,000 KiB free. The
configured coarse model-storage reserve is 160 GiB, so doctor reports
``MODEL_STORAGE_CAPACITY=INSUFFICIENT`` and the full Qwen snapshot remains
deferred. No weights are downloaded while data is collecting.
Cut Cross Entropy 25.1.1. The source is ``Qwen/Qwen3.8-27B`` at revision
``8c0b3d30f3ae96f5c7f774de704bf0ada83e422a``.

Capacity and availability are separate: the assigned GPU has 97,887 MiB
total, and the training run needs the inference service stopped or the
remaining memory checked first. Operator-controlled training may stop the
known inference service and re-check free VRAM before launch.

Inference management discovery
------------------------------
Expand Down Expand Up @@ -103,10 +94,9 @@ pattern is conceptually::
uv pip install --no-build-isolation 'axolotl[deepspeed]'

Choose the CUDA/PyTorch matrix appropriate for the actual GPU and approved
host image. Keep the environment isolated from inference. For Qwen3-Next,
install only the extra performance dependencies that the operator elects to
use after reviewing the current Axolotl model guide (for example Cut Cross
Entropy and the documented FLA version); do not enable optional kernels by
host image. Keep the environment isolated from inference. Install only the
extra performance dependencies that the operator elects to use after
reviewing the current Axolotl documentation; do not enable optional kernels by
default.

Trusted execution contract
Expand Down Expand Up @@ -137,17 +127,14 @@ hardware capacity from TOTAL VRAM, current GPU availability from free VRAM and
known workload activity, and dataset readiness. A BUSY current GPU is not a
hardware-capacity failure.

Qwen3-Next planning notes
-------------------------

The source must be the Transformers/Hugging Face
``Qwen/Qwen3-Coder-Next`` checkpoint at an immutable commit revision. GGUF is
an inference artifact and is rejected as a training source. The first profile
is conservative QLoRA: 4-bit loading, attention-only LoRA targets, no expert
targeting, gradient checkpointing, small micro-batch, and no packing. Axolotl's
Qwen3-Next guide gives approximately 47 GiB for no-expert-targeting QLoRA and
approximately 71 GiB when targeting experts; these are coarse planning values,
not an admission guarantee. Existing GPU processes must not be killed to make
Source model
------------

The source must be the Transformers/Hugging Face ``Qwen/Qwen3.8-27B``
checkpoint at an immutable commit revision. GGUF is an inference artifact and
is rejected as a training source. The profile is conservative QLoRA: 4-bit
loading, attention-only LoRA targets, gradient checkpointing, small
micro-batch, and no packing. Existing GPU processes must not be killed to make
room. Configure a minimum free-VRAM policy if the operator needs one.

Non-training validation
Expand All @@ -172,5 +159,4 @@ References
----------

* https://docs.axolotl.ai/docs/installation.html
* https://docs.axolotl.ai/docs/models/qwen3-next.html
* https://docs.axolotl.ai/docs/cli.html
4 changes: 2 additions & 2 deletions client/eval/abstention/build_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ def load_tokenizer():
"""The pinned tokenizer, offline. The rendering has to be the real one."""
from transformers import AutoTokenizer
return AutoTokenizer.from_pretrained(
"Qwen/Qwen3-Coder-Next",
revision="a7fbcb5c0e12d62a448eaa0e260346bf5dcc0feb")
"Qwen/Qwen3.8-27B",
revision="8c0b3d30f3ae96f5c7f774de704bf0ada83e422a")


def main(out_dir, tokenizer=None):
Expand Down
5 changes: 2 additions & 3 deletions client/models/remote_readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def inspect(self) -> RemoteReadinessReport:
printf 'model_snapshot_status=READY\n'
else printf 'model_snapshot_status=NOT_PRESENT\n'; fi
ram=$(awk '/MemTotal:/ {print $2}' /proc/meminfo 2>/dev/null || true); printf 'ram_kib=%s\n' "${ram:-unknown}"
for module in torch transformers peft bitsandbytes qwen3_next; do
for module in torch transformers peft bitsandbytes; do
"$py" - "$module" <<'PY' 2>/dev/null || true
import importlib, sys
name = sys.argv[1]
Expand Down Expand Up @@ -377,7 +377,6 @@ def inspect(self) -> RemoteReadinessReport:
else RemoteReadinessState.READY)

checks["environment_readiness"] = state.value
checks["qwen3_next_compatibility"] = state.value

return RemoteReadinessReport(state.value, tuple(dict.fromkeys(reasons)), checks,
self.configuration.host, _now())
Expand Down Expand Up @@ -546,7 +545,7 @@ def local_doctor(store: TrainingStore | str | os.PathLike[str],
checks["launcher"] = "ssh"
checks["host"] = config.host
checks["ssh_identity"] = "CONFIGURED" if config.ssh_identity_file else "SYSTEM_DEFAULT"
checks["model_source"] = "Qwen/Qwen3-Coder-Next"
checks["model_source"] = "Qwen/Qwen3.8-27B"
checks["model_revision"] = ("PINNED" if (model_revision or config.source_model_revision)
else "MISSING")

Expand Down
2 changes: 1 addition & 1 deletion client/tests/test_hardened_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

POLICY = CommandPolicy()

# The command Coder-Next ran at step 78 of sye-uboot-patch/3, its paths
# The command the model ran at step 78 of sye-uboot-patch/3, its paths
# shortened: refused as a heredoc and as a script, it ran as `python3 -c`.

OBSERVED = (
Expand Down
2 changes: 1 addition & 1 deletion client/tests/test_normative_precedence.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def test_the_rule_names_the_artefacts_that_are_not_evidence(self):
class ProseKeepsItsCitation(unittest.TestCase):
"""What the real backend wrote, and what sentence-local grounding did to it.

Qwen3-Coder-Next, bound to the standard, quoted the rule in full, concluded
The served model, bound to the standard, quoted the rule in full, concluded
from it, and closed with a restatement carrying no citation of its own.
The first version of this guard replaced that true, retrieved, correctly
cited claim with a note saying nothing backed it -- a worse sentence than
Expand Down
6 changes: 0 additions & 6 deletions client/tests/test_public_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,19 +258,13 @@ class NoStaleProductPrefixEscapes(unittest.TestCase):

JUSTIFIED = {
# --- persistent identifiers, named where they are defined ---
".gitignore":
"guards a 47 GB directory this deployment still has on disk; "
"renaming the rule without moving the directory exposes it",

# --- historical evidence: transcripts and measured incidents ---
"client/TRAINING_DATA.md":
"narrates a run against a path that was actually tried",
"client/doc/source/training_host_setup.rst":
"the same narrative: the path Axolotl was not usable at",
"doc/source/model_serving.rst":
"a recorded backend probe and its literal reply",
"pod-artifacts-qwen3coder/gguf-download.log":
"a download log from one run; evidence, not source",

# --- checks that must name what they forbid ---
"client/tests/test_public_boundary.py":
Expand Down
2 changes: 1 addition & 1 deletion client/tests/test_remote_readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_remote_success_parses_environment_and_ready_state(self):
"training_root=usable\ndisk_available_kib=80000\n"
"ram_kib=1000000\npackage=torch:2.12.0\n"
"package=transformers:5.8.0\npackage=peft:0.18.0\n"
"package=bitsandbytes:available\npackage=qwen3_next:available\n")
"package=bitsandbytes:available\n")
runner = ProbeRunner([ok("host config"), ok(), ok(output)])
report = SSHRemoteProbe(self.config(), runner).inspect()
self.assertEqual(report.state, RemoteReadinessState.READY.value)
Expand Down
60 changes: 14 additions & 46 deletions client/tests/test_training_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,70 +40,38 @@ def positive_store(self, root):
]))

def test_source_profiles_and_gguf_rejection(self):
default = SourceModelProfile.named("qwen3_coder_next_sft")
self.assertEqual(default.base_model, "Qwen/Qwen3-Coder-Next")
default = SourceModelProfile.named("qwen38_27b_sft")
self.assertEqual(default.base_model, "Qwen/Qwen3.8-27B")
self.assertEqual(default.source_kind, "instruct_post_trained")
base = SourceModelProfile.named("qwen3_coder_next_base")
self.assertEqual(base.base_model, "Qwen/Qwen3-Coder-Next-Base")
base.validate()
self.assertIsNone(default.revision)
default.validate()
with self.assertRaises(TrainingBundleError):
replace(default, base_model="deployed/model.gguf").validate()

def test_axolotl_configs_are_semantic_qlora_and_conservative_moe(self):
def test_axolotl_configs_are_semantic_qlora(self):
generator = AxolotlConfigGenerator(SourceModelProfile(), AxolotlProfile())
sft, kto, dpo = generator.sft(), generator.kto(), generator.dpo()
self.assertIn("adapter: qlora", sft)
self.assertIn("load_in_4bit: true", sft)
# load_in_4bit alone does not quantize this model's routed experts:
# under transformers 5.x they are fused 3-D nn.Parameter tensors and
# bitsandbytes only replaces nn.Linear. Asking for 4-bit without this
# flag is how a run ended up holding 148 GiB of bf16 experts.
self.assertIn("quantize_moe_experts: true", sft)
self.assertIn("base_model: \"Qwen/Qwen3.8-27B\"", sft)
self.assertIn("message_field_training: train", sft)
self.assertIn("chat_template: tokenizer_default", sft)
# Conservative means no expert TARGETING -- a different thing from
# expert quantization, which the line above requires. The targeting
# section must be absent, and routed experts must never appear as
# lora_target_modules: they are parameters, not modules.
self.assertNotIn("lora_target_parameters", sft)
self.assertNotIn("gate_up_proj", sft)
self.assertIn("rl: kto", kto)
self.assertIn("rl: dpo", dpo)
self.assertNotIn("<|im_start|>", sft + kto + dpo)

def test_feasibility_depends_on_how_the_experts_are_loaded(self):
"""96 GiB is insufficient or ample depending on one flag.

The old table said ">= 96 GiB may fit" whatever the config, and the
config it shipped left the routed experts in bf16 -- where the weights
alone measured 152 010 MiB on a B200. A verdict that ignores the load
mode sends an operator to rent the wrong card either way.
"""
def test_feasibility_follows_the_card(self):
card = TrainingHardwareReport(
True, ("RTX PRO 6000",), 1, 96.0, ("12.0",), 256.0, 900.0,
"linux", "test", VRAMFeasibility.UNKNOWN.value, (),
)
bf16 = card.classify(quantize_moe_experts=False)
self.assertEqual(bf16.vram_feasibility,
VRAMFeasibility.LIKELY_DOES_NOT_FIT.value)
self.assertTrue(any("bf16" in w for w in bf16.warnings))

quantized = card.classify(quantize_moe_experts=True)
self.assertEqual(quantized.vram_feasibility, VRAMFeasibility.MAY_FIT.value)
# Never LIKELY_FITS on that path: the figure behind it is Axolotl's
# documentation, not a measurement made here.
self.assertTrue(any("preflight" in w for w in quantized.warnings))

targeting = card.classify(quantize_moe_experts=True, expert_targeting=True)
self.assertEqual(targeting.vram_feasibility, VRAMFeasibility.MAY_FIT.value)
small = replace(card, total_vram_gib=48.0).classify(
quantize_moe_experts=True, expert_targeting=True)
self.assertEqual(small.vram_feasibility,
VRAMFeasibility.LIKELY_DOES_NOT_FIT.value)

# Told nothing, it stays coarse and says so.
silent = card.classify()
self.assertTrue(any("not declared" in w for w in silent.warnings))

for vram, verdict in ((96.0, VRAMFeasibility.LIKELY_FITS),
(48.0, VRAMFeasibility.MAY_FIT),
(24.0, VRAMFeasibility.LIKELY_DOES_NOT_FIT),
(None, VRAMFeasibility.UNKNOWN)):
self.assertEqual(replace(card, total_vram_gib=vram).classify().vram_feasibility,
verdict.value)

def test_freeze_is_deterministic_immutable_and_masked(self):
with tempfile.TemporaryDirectory() as directory:
Expand Down
2 changes: 1 addition & 1 deletion client/tests/test_training_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def job(job_id="ftjob_" + "a" * 24):
return TrainingJob(
job_id, "SFT", "training_bundle", "/bundle", "b" * 64, "c" * 64,
"Qwen/Qwen3-Coder-Next", "deadbeef", {"train": "d" * 64},
"Qwen/Qwen3.8-27B", "deadbeef", {"train": "d" * 64},
"fake", "fake", f"fake://jobs/{job_id}",
)

Expand Down
Loading
Loading