longcat: SimpleTuner requires --optimizer (v0.2.59)

The CONFIG_PATH fix worked — SimpleTuner read the config, mapped it to CLI args
and got as far as argparse, which then said:

  argparse.ArgumentError: the following arguments are required: --optimizer

It has no default for it. The config now sets adamw_bf16, overridable per job.
That choice matters here rather than being arbitrary: Adam normally carries two
fp32 moments per parameter, which for a 13.6B base is more optimiser state than
the card has. base_model_precision quantises the weights; adamw_bf16 keeps the
state in bf16. Together they are what make this trainable on one consumer GPU.

Also fixed how a SimpleTuner failure is reported. It raised with the last six
lines of output, which for a traceback is frame noise — the line naming the cause
was above the cut, which is why the first look at this error showed argparse
internals and not the message. It now prefers lines that look like a cause
(Error/Exception/required:/not found) and falls back to the raw tail.

Verified against the installed package: every key the config emits exists in
SimpleTuner's field registry, and adamw_bf16 is in optimizer_choices.
Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0182DhR1eFNPQyGmDrpHbedY
parent 7f54eb80
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# Canonical product version for CoderAI — single source of truth. Both the API # Canonical product version for CoderAI — single source of truth. Both the API
# metadata and the admin web UI read from here. # metadata and the admin web UI read from here.
__version__ = "0.2.58" __version__ = "0.2.59"
__tagline__ = "Complete orchestration, distribution and escalation of remotizable advanced inference." __tagline__ = "Complete orchestration, distribution and escalation of remotizable advanced inference."
# Configure the CUDA caching allocator BEFORE torch is imported anywhere. # Configure the CUDA caching allocator BEFORE torch is imported anywhere.
......
...@@ -73,6 +73,15 @@ def build_config(job: dict) -> dict: ...@@ -73,6 +73,15 @@ def build_config(job: dict) -> dict:
"validation_resolution": job.get("resolution") or "480x832", "validation_resolution": job.get("resolution") or "480x832",
"validation_num_video_frames": int(job.get("num_frames") or 93), "validation_num_video_frames": int(job.get("num_frames") or 93),
"tracker_project_name": "coderai-longcat-lora", "tracker_project_name": "coderai-longcat-lora",
# SimpleTuner has no default for this — it is a REQUIRED argument, and
# omitting it fails at argparse with "the following arguments are
# required: --optimizer", long before anything is loaded.
#
# adamw_bf16 keeps the optimiser state in bf16 rather than fp32, which is
# what makes a 13.6B base trainable on one consumer card at all: Adam
# normally carries two fp32 moments per parameter. The quantised base
# (base_model_precision) covers the weights; this covers the state.
"optimizer": job.get("optimizer") or "adamw_bf16",
} }
# QLoRA: the quantised base. Without it the 13.6B transformer plus optimiser state # QLoRA: the quantised base. Without it the 13.6B transformer plus optimiser state
# does not fit a consumer card. # does not fit a consumer card.
...@@ -175,8 +184,14 @@ def main(argv=None) -> int: ...@@ -175,8 +184,14 @@ def main(argv=None) -> int:
+ (f", loss {loss.group(1)}" if loss else ""))) + (f", loss {loss.group(1)}" if loss else "")))
rc = proc.wait() rc = proc.wait()
if rc != 0: if rc != 0:
raise RuntimeError(f"SimpleTuner exited {rc}. Last output: " # The last few lines of a traceback are frame noise — the line that
+ " | ".join(tail[-6:])) # says what went wrong is usually further up. Prefer an exception or
# error line if one is in the tail; fall back to the raw end.
import re as _re
_signal = [t for t in tail
if _re.search(r"(Error|error:|Exception|required:|No such|not found)", t)]
_detail = " | ".join((_signal or tail)[-4:])
raise RuntimeError(f"SimpleTuner exited {rc}: {_detail}")
# The adapter SimpleTuner wrote. Reported as a path rather than moved: the # The adapter SimpleTuner wrote. Reported as a path rather than moved: the
# parent owns where a LoRA is registered. # parent owns where a LoRA is registered.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment