Repository navigation
Decision models: follow-up fixes after #12772, #12876, #12939 - #12949
Conversation
…wnload, GGUF-only no-torch serving and GPU order
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…n until Laya serves
… Qwen3.5 precision path without a weight dtype
…cpp on no-torch installs
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 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".
| try: | ||
| from core.inference.llama_cpp import LlamaCppBackend | ||
| return bool(LlamaCppBackend._get_gpu_free_memory()) |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| try: | ||
| order = [int(x) for x in (mask or "").split(",") if x.strip()] |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
Not changing: a trailing -1 sentinel in a reordered mask is not a configuration Studio users set; mismatched lengths fall back to physical order.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 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()] |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
…he idle unload test race
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
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.scripts/train_decision_from_lm.py).head_initHub downloads honourlocal_files_only.Studio Decision API
CUDA_VISIBLE_DEVICESorder, matching llama.cpp's device numbering.layout, so an env-configured local Clef checkpoint shows the runtime selector.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 --noEmitclean.