[PR #589] [CLOSED] make_profile: --reorder so a trace can rank ahead of a complete base #2711

Closed
opened 2026-11-04 02:02:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/589
Author: @yannickloth
Created: 10/3/2026
Status: ❌ Closed

Base: main ← Head: p8/make-profile-reorder


📝 Commits (1)

  • f4f7396 make_profile: --reorder so a trace can rank ahead of a complete base

📊 Changes

2 files changed (+143 additions, -19 deletions)

View changed files

📝 tools/make_profile.py (+39 -19)
➕ tools/test_make_profile.py (+104 -0)

📄 Description

Fixes #587.

tools/make_profile.py ranks the base first, then the trace pairs, then the fill. The base is only appended to, and the shipped data/expert-profile.bin ranks all 24,576 pairs — so --base <trace> was a no-op (reported 0 from the traces, byte-identical output), and a --dump-routing trace could never order the VRAM tier that --expert-cache auto fills from the profile.

Add --reorder: rank the trace's pairs first (most frequent first), let the base fill the rest, then the fill. The default is unchanged; --no-base is unchanged.

The ranking moves into rank_profile() so it can be tested without a model.

  • tools/make_profile.py: rank_profile(), the --reorder flag, docstring
  • tools/test_make_profile.py: 7 unittest cases — the no-op, --reorder, --no-base, the frequency/tie order, --reorder with no traces, and an end-to-end run over a complete base
$ python -m unittest tools.test_make_profile
Ran 7 tests in 0.002s
OK

On this host's coding trace against the shipped profile the same command now reports 5808 from the traces and reorders the top; without --reorder the output is still byte-identical to data/expert-profile.bin.

Relevant to the profile-seeding workflow behind #477 (--expert-profile-save now persists what the adaptive tier learns; this is the offline/one-shot counterpart for a known workload).


🔄 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/589 **Author:** [@yannickloth](https://github.com/yannickloth) **Created:** 10/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `p8/make-profile-reorder` --- ### 📝 Commits (1) - [`f4f7396`](https://github.com/Niko1221/Strata/commit/f4f7396549230296df11b13eb265593b16642d3e) make_profile: --reorder so a trace can rank ahead of a complete base ### 📊 Changes **2 files changed** (+143 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `tools/make_profile.py` (+39 -19) ➕ `tools/test_make_profile.py` (+104 -0) </details> ### 📄 Description Fixes #587. `tools/make_profile.py` ranks the base first, then the trace pairs, then the fill. The base is only appended to, and the shipped `data/expert-profile.bin` ranks all 24,576 pairs — so `--base <trace>` was a no-op (reported `0 from the traces`, byte-identical output), and a `--dump-routing` trace could never order the VRAM tier that `--expert-cache auto` fills from the profile. Add `--reorder`: rank the trace's pairs first (most frequent first), let the base fill the rest, then the fill. The default is unchanged; `--no-base` is unchanged. The ranking moves into `rank_profile()` so it can be tested without a model. - `tools/make_profile.py`: `rank_profile()`, the `--reorder` flag, docstring - `tools/test_make_profile.py`: 7 unittest cases — the no-op, `--reorder`, `--no-base`, the frequency/tie order, `--reorder` with no traces, and an end-to-end run over a complete base ``` $ python -m unittest tools.test_make_profile Ran 7 tests in 0.002s OK ``` On this host's coding trace against the shipped profile the same command now reports `5808 from the traces` and reorders the top; without `--reorder` the output is still byte-identical to `data/expert-profile.bin`. Relevant to the profile-seeding workflow behind #477 (`--expert-profile-save` now persists what the adaptive tier learns; this is the offline/one-shot counterpart for a known workload). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:02:33 +07:00
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#2711
No description provided.