mirror of
https://github.com/debpalash/VoiceStudio.git
synced 2026-12-05 09:58:17 +00:00
* feat(gpu): add opt-in native Windows ROCm installation Use one pinned Windows recipe for source and Electron setup, verify native packages before reuse, and preserve explicit opt-in and sidecar compatibility boundaries. * docs(rocm): drop agent-instruction plan files; move the entry to a changelog fragment * fix(rocm): hash-pin every AMD artifact and keep dependencies at their locked versions Each repo.radeon.com wheel/sdist now carries a sha256 in the recipe, the loader refuses one without it, and the installer installs from a --hash requirements file (uv verifies; UV_NO_VERIFY_HASHES is stripped). A constraints file pins every installed package except the overlay (torch family, rocm*, triton*, ctranslate2), so transitive deps no longer resolve fresh from the index. The rocm sdist builds with the locked setuptools. * fix(rocm): ask before switching an existing runtime to Windows ROCm OMNIVOICE_TORCH_VARIANT=rocm used to be ignored on Windows; with this PR it would fail readiness on update and auto-repair into a multi-GB download from new hosts. A successful install now records its torch build (.runtime-torch); a runtime never installed with Windows ROCm goes to the setup screen instead of auto-repair. ROCm on Windows ARM64 reports not-ready instead of rejecting readiness, and the setup screen names repo.radeon.com as the Windows ROCm torch source. * fix(rocm): resolve ROCm packages from site-packages and remember a failed GPU probe package_root() finds torch, ctranslate2 and the ROCm SDK packages through their distribution records in this interpreter's site-packages, so a stray folder in the working directory of a -m child can't choose the DLL directories. A failed HIP CT2 probe (up to 90 s) is remembered for the process instead of 5 s, so catalogue refreshes don't re-run it; a restart, recipe or package change runs it again. * docs(rocm): record the owner-approved Windows ROCm endpoints and how setup checks them * docs(structure): count the pyannote compat service module * test(rocm): pin the host architecture in the setup-reuse readiness test * fix(repo): untrack the committed .venv symlink and ignore symlinked envs; follow the new ROCm copy in the GPU panel test .gitignore's '.venv/' only matches directories, so a worktree's symlinked .venv was committed and CI's uv sync failed on it. Ignore '.venv' without the slash and add a guard that no local environment path is ever tracked. * test(audio-io): allow the pyannote torchaudio shim, which applies the gate's own fix to third-party calls --------- Co-authored-by: debpalash <4178343+debpalash@users.noreply.github.com>
118 lines
3.6 KiB
JavaScript
118 lines
3.6 KiB
JavaScript
import { test } from "node:test";
|
|
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import { setupApi } from "../../scripts/setup-api.mjs";
|
|
import { selectTorchVariant } from "../../electron/scripts/torch-variant.mjs";
|
|
|
|
test("Windows x64 ROCm is explicit and never queries NVIDIA", async () => {
|
|
assert.equal(
|
|
await selectTorchVariant({
|
|
platform: "win32",
|
|
arch: "x64",
|
|
env: { OMNIVOICE_TORCH_VARIANT: " ROCm " },
|
|
nvidiaAvailable: () => {
|
|
throw Error("unexpected probe");
|
|
},
|
|
}),
|
|
"rocm",
|
|
);
|
|
});
|
|
|
|
test("Windows ARM64 refuses the native ROCm recipe before sync", async () => {
|
|
await assert.rejects(
|
|
selectTorchVariant({
|
|
platform: "win32",
|
|
arch: "arm64",
|
|
env: { OMNIVOICE_TORCH_VARIANT: "rocm" },
|
|
}),
|
|
/Windows.*x64/,
|
|
);
|
|
});
|
|
|
|
test("source ROCm sync protects the overlay and installs before native repair", async () => {
|
|
const calls = [];
|
|
const env = { OMNIVOICE_TORCH_VARIANT: " ROCm ", UV_PROJECT_ENVIRONMENT: "H:/Voice Env" };
|
|
const status = await setupApi({
|
|
platform: "win32",
|
|
arch: "x64",
|
|
env,
|
|
log: () => {},
|
|
repairNativeLibraries: async () => {
|
|
calls.push(["repair"]);
|
|
},
|
|
run: (command, args, options) => {
|
|
calls.push([command, args, options]);
|
|
return { status: 0 };
|
|
},
|
|
});
|
|
assert.equal(status, 0);
|
|
const sync = calls[0][1];
|
|
assert.ok(sync.includes("--inexact"));
|
|
assert.equal(sync[sync.indexOf("--python") + 1], "cpython-3.12-windows-x86_64");
|
|
const excluded = sync.flatMap((arg, i) => (arg === "--no-install-package" ? [sync[i + 1]] : []));
|
|
assert.ok(
|
|
["torch", "torchaudio", "torchvision", "ctranslate2", "nvidia-cudnn-cu12"].every((name) =>
|
|
excluded.includes(name),
|
|
),
|
|
);
|
|
assert.ok(!excluded.includes("nvidia-ml-py"));
|
|
assert.deepEqual(calls[1][1], [
|
|
"run",
|
|
"--no-sync",
|
|
"python",
|
|
"scripts/setup.py",
|
|
"--windows-prerequisites-only",
|
|
]);
|
|
assert.deepEqual(calls[2][1], [
|
|
"run",
|
|
"--no-sync",
|
|
"python",
|
|
"-m",
|
|
"backend.core.windows_rocm.install",
|
|
"--uv",
|
|
"uv",
|
|
]);
|
|
assert.equal(calls[2][2].env.OMNIVOICE_TORCH_VARIANT, "rocm");
|
|
assert.equal(calls[2][2].env.UV_PROJECT_ENVIRONMENT, env.UV_PROJECT_ENVIRONMENT);
|
|
assert.deepEqual(calls[3], ["repair"]);
|
|
assert.deepEqual(calls[4][1], ["run", "--no-sync", "python", "scripts/setup.py"]);
|
|
assert.equal(env.OMNIVOICE_TORCH_VARIANT, " ROCm ");
|
|
});
|
|
|
|
test("a failed Windows overlay stops setup before native imports", async () => {
|
|
let repaired = false;
|
|
const calls = [];
|
|
assert.equal(
|
|
await setupApi({
|
|
platform: "win32",
|
|
arch: "x64",
|
|
env: { OMNIVOICE_TORCH_VARIANT: "rocm" },
|
|
log: () => {},
|
|
repairNativeLibraries: async () => {
|
|
repaired = true;
|
|
},
|
|
run: (_command, args) => {
|
|
calls.push(args);
|
|
return { status: args.includes("backend.core.windows_rocm.install") ? 1 : 0 };
|
|
},
|
|
}),
|
|
1,
|
|
);
|
|
assert.equal(repaired, false);
|
|
assert.equal(calls.length, 3);
|
|
});
|
|
|
|
test("packaging carries the recipe and all shared native helpers", async () => {
|
|
const { default: config } = await import("../../electron/electron-builder.config.mjs");
|
|
assert.ok(config.extraResources.some((item) => item.to === "scripts/windows-rocm-recipe.json"));
|
|
assert.ok(config.extraResources.some((item) => item.to === "scripts/smoke_windows_rocm.py"));
|
|
const backend = config.extraResources.find((item) => item.to === "backend");
|
|
assert.ok(backend.filter.includes("**/*"));
|
|
assert.ok(
|
|
readFileSync(
|
|
new URL("../../backend/core/windows_rocm/install.py", import.meta.url),
|
|
"utf8",
|
|
).includes("def main("),
|
|
);
|
|
});
|