Skip to content

Decision models: follow-up fixes after #12772, #12876, #12939 - #12949

Merged
danielhanchen merged 10 commits into
mainfrom
decision-followups
Oct 7, 2026
Merged

danielhanchen merged 10 commits into
mainfrom
decision-followups

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up fixes for #12772, #12876 and #12939, from the review rounds that landed after they merged.

Training and datasets

  • build_decision_mixture: zero-weight sources are skipped instead of loading at least one row; negative or all-zero weight maps are rejected.
  • Sources load with 2x headroom before decontamination, so a few dropped rows no longer force resampling with replacement (also in scripts/train_decision_from_lm.py).
  • The training script decontaminates against the raw evaluation states, so both sides serialize with sorted keys.
  • Calibration is skipped when the holdout is empty instead of producing NaN metrics.
  • head_init Hub downloads honour local_files_only.
  • The Qwen3.5 precision message now says what happens: float16 weights with float32 activations, not float32 training.

Studio Decision API

  • GGUF-only catalog models (llama.cpp) can be enabled and are listed on installs without PyTorch.
  • The settings page reports the device llama.cpp actually uses when no device is stored.
  • The freest GPU is chosen in CUDA_VISIBLE_DEVICES order, matching llama.cpp's device numbering.
  • The settings response carries the configured model's layout, so an env-configured local Clef checkpoint shows the runtime selector.
  • A stale Clef fallback reason is cleared once a Laya model serves.

Tests: tests/test_decision_datasets.py (zero weights, fails on main), studio/backend/tests/test_decision_native.py (visibility order), updated no-torch listing test. Studio decision suites 348 passed; tsc --noEmit clean.

…wnload, GGUF-only no-torch serving and GPU order
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T16:03:09.998997Z 7448f5c Manual request
🔒 Security Review ⚠️ Failed 2026-10-07T13:51:49.553489Z ccf40aa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-10-07T13:51:49.553489Z ccf40aa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

… Qwen3.5 precision path without a weight dtype
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64c6a1cb64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +206 to +208
try:
from core.inference.llama_cpp import LlamaCppBackend
return bool(LlamaCppBackend._get_gpu_free_memory())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Detect ROCm GPUs without importing PyTorch

On a --no-torch AMD installation using a ROCm llama.cpp build, this fallback still returns false: _get_gpu_free_memory() reaches _get_gpu_memory_amd_smi(), which immediately imports torch and returns an empty list when that import fails, and its final fallback also requires torch. Fresh evidence beyond the resolved no-torch comment is this explicit dependency in the AMD probe, so the UI still disables GPU and clef_device() launches these GGUF models with CPU offload despite a usable AMD GPU.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing here: the shared amd-smi probe needing torch predates this PR and affects every no-torch GGUF load on AMD, so it belongs in a separate fix to that probe.

Comment on lines +271 to +272
try:
order = [int(x) for x in (mask or "").split(",") if x.strip()]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop CUDA mask parsing at the terminating sentinel

When CUDA_VISIBLE_DEVICES contains a valid reordered prefix followed by CUDA's terminating invalid entry, such as 1,0,-1, llama.cpp exposes the two prefix devices in that order, but this parser retains -1. The resulting length mismatch falls back to sorting the physical free-memory IDs as 0,1, so compact CUDA0 and CUDA1 are mapped backwards and the busier GPU can be selected. Parse only the visible prefix, stopping at the first invalid or negative entry, before comparing its length with devices.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing: a trailing -1 sentinel in a reordered mask is not a configuration Studio users set; mismatched lengths fall back to physical order.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf08833086

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# HIP falls back to CUDA_VISIBLE_DEVICES when its own mask is unset.
mask = env.get("HIP_VISIBLE_DEVICES") or env.get("CUDA_VISIBLE_DEVICES")
try:
order = [int(x) for x in (mask or "").split(",") if x.strip()]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not treat CUDA ordinals as physical GPU indices

On heterogeneous NVIDIA hosts using CUDA's default FASTEST_FIRST ordering, numeric CUDA_VISIBLE_DEVICES entries are CUDA ordinals, while by_index comes from nvidia-smi and is keyed by physical PCI index. For a reordered mask such as 1,0, this can therefore associate CUDA0 with the wrong memory row and select the busier GPU, potentially causing avoidable OOMs. The repository already guards this distinction in _cuda_compute_caps; only use the numeric mask as a physical ordering when CUDA_DEVICE_ORDER=PCI_BUS_ID, or resolve the ordinal-to-physical mapping first.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing: on homogeneous hosts FASTEST_FIRST ties break in PCI order, so ordinals match nvidia-smi indices. Gating the remap on PCI_BUS_ID would mis-map that common case; heterogeneous cards with a reordered numeric mask and no PCI_BUS_ID is the narrow remainder.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 7, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 7448f5c2de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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