[PR #4296] [Other] setup: keep the Unsloth env when a hipBLASLt table is found #4988

Open
opened 2026-11-07 16:31:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4296
Author: @AMV007
Created: 10/27/2026
Status: 🔄 Open

Base: main ← Head: fix-hip-env-overwrite


📝 Commits (1)

  • 4b266a1 setup: a hipBLASLt table found for an AMD card is added to the run config's env instead of replacing it (with a table, UD-Q5/Q6_K_XL lost STRATA_MMQ_KQ=1 and a full-RAM Unsloth install lost STRATA_ROUTE_TAIL_SKIP=0); test

📊 Changes

2 files changed (+16 additions, -1 deletions)

View changed files

📝 setup.py (+1 -1)
📝 tools/test_setup_unsloth.py (+15 -0)

📄 Description

Problem and result

In main(), when hipblaslt_table() finds a table for an AMD card, setup sets cfg["env"] = {"STRATA_HIPBLASLT_TUNING": ...}. That replaces the env unsloth_default_env() wrote a few lines earlier (since 107f9b62). Before: with a table, UD-Q5_K_XL / UD-Q6_K_XL lose STRATA_MMQ_KQ=1, and a full-RAM Unsloth install loses STRATA_ROUTE_TAIL_SKIP=0. After: both stay beside STRATA_HIPBLASLT_TUNING. Cards without a table are unchanged.

none

Approach

A one-line change: cfg.setdefault("env", {})["STRATA_HIPBLASLT_TUNING"] = str(table). This is the same pattern the gfx1103, gfx1150, rocBLAS and resident branches right below already use. No other behaviour changes.

Validation

Passed:

  • New test tools/test_setup_unsloth.py::Main::test_amd_hipblaslt_table_keeps_the_unsloth_env (R9700, UD-Q5_K_XL, table mocked). On 4b9e05a2 without the fix it fails with KeyError: 'STRATA_MMQ_KQ'; with the fix it passes.
  • python -m unittest tools.test_setup_unsloth tools.test_setup_golden tools.test_setup_menu tools.test_setup_strix_halo tools.test_setup_amd tools.test_setup_small_card tools.test_setup_choices tools.test_setup_configs tools.test_setup_config on 4b9e05a2, Ubuntu, Python 3.12: the same set of results with and without the change.

Failed:

  • 53 tests in those modules fail on this machine on unmodified 4b9e05a2 too (the same list before and after the change; they look environment-dependent). No new failure.

Not run:

  • A real setup run on an AMD card with UD-Q5/Q6_K_XL.

Limits

none


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4296 **Author:** [@AMV007](https://github.com/AMV007) **Created:** 10/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-hip-env-overwrite` --- ### 📝 Commits (1) - [`4b266a1`](https://github.com/Niko1221/Strata/commit/4b266a118065db214e515686c892f133b1791caf) setup: a hipBLASLt table found for an AMD card is added to the run config's env instead of replacing it (with a table, UD-Q5/Q6_K_XL lost STRATA_MMQ_KQ=1 and a full-RAM Unsloth install lost STRATA_ROUTE_TAIL_SKIP=0); test ### 📊 Changes **2 files changed** (+16 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `setup.py` (+1 -1) 📝 `tools/test_setup_unsloth.py` (+15 -0) </details> ### 📄 Description ## Problem and result In `main()`, when `hipblaslt_table()` finds a table for an AMD card, setup sets `cfg["env"] = {"STRATA_HIPBLASLT_TUNING": ...}`. That replaces the env `unsloth_default_env()` wrote a few lines earlier (since 107f9b62). Before: with a table, UD-Q5_K_XL / UD-Q6_K_XL lose `STRATA_MMQ_KQ=1`, and a full-RAM Unsloth install loses `STRATA_ROUTE_TAIL_SKIP=0`. After: both stay beside `STRATA_HIPBLASLT_TUNING`. Cards without a table are unchanged. ## Related discussion none ## Approach A one-line change: `cfg.setdefault("env", {})["STRATA_HIPBLASLT_TUNING"] = str(table)`. This is the same pattern the gfx1103, gfx1150, rocBLAS and resident branches right below already use. No other behaviour changes. ## Validation **Passed:** - New test `tools/test_setup_unsloth.py::Main::test_amd_hipblaslt_table_keeps_the_unsloth_env` (R9700, UD-Q5_K_XL, table mocked). On 4b9e05a2 without the fix it fails with `KeyError: 'STRATA_MMQ_KQ'`; with the fix it passes. - `python -m unittest tools.test_setup_unsloth tools.test_setup_golden tools.test_setup_menu tools.test_setup_strix_halo tools.test_setup_amd tools.test_setup_small_card tools.test_setup_choices tools.test_setup_configs tools.test_setup_config` on 4b9e05a2, Ubuntu, Python 3.12: the same set of results with and without the change. **Failed:** - 53 tests in those modules fail on this machine on unmodified 4b9e05a2 too (the same list before and after the change; they look environment-dependent). No new failure. **Not run:** - A real setup run on an AMD card with UD-Q5/Q6_K_XL. ## Limits none --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4988
No description provided.