|
| 1 | +// G16: cross-arch coverage for presets whose brick names don't follow |
| 2 | +// `{preset}_mlp` / `{preset}_attn` convention. V4-12 hardcoded the |
| 3 | +// canonical pattern and skipped these 9. v5 supplies explicit |
| 4 | +// mlp_id / attn_id per preset. |
| 5 | + |
| 6 | +import { test, expect } from "@playwright/test"; |
| 7 | +import { gotoApp, selectPreset, clickRunPipeline, closeModal } from "../fixtures"; |
| 8 | +import { readTrainExtras } from "../utils/train_extras"; |
| 9 | + |
| 10 | +interface Entry { preset: string; mlpId: string; attnId: string; } |
| 11 | + |
| 12 | +const ENTRIES: Entry[] = [ |
| 13 | + { preset: "glm_45", mlpId: "glm_45_shared", attnId: "glm_45_attn" }, |
| 14 | + { preset: "glm_45_air", mlpId: "glm_45_air_shared", attnId: "glm_45_air_attn" }, |
| 15 | + { preset: "glm_47", mlpId: "glm_47_shared", attnId: "glm_47_attn" }, |
| 16 | + { preset: "intellect_3", mlpId: "intellect_3_shared",attnId: "intellect_3_attn" }, |
| 17 | + { preset: "qwen3_dense_0_6b", mlpId: "qwen3_0_6b_mlp", attnId: "qwen3_0_6b_attn" }, |
| 18 | + { preset: "qwen3_dense_32b", mlpId: "qwen3_32b_mlp", attnId: "qwen3_32b_attn" }, |
| 19 | + { preset: "qwen3_dense_4b", mlpId: "qwen3_4b_mlp", attnId: "qwen3_4b_attn" }, |
| 20 | + { preset: "qwen3_dense_8b", mlpId: "qwen3_8b_mlp", attnId: "qwen3_8b_attn" }, |
| 21 | + { preset: "sarvam_30b", mlpId: "sarvam_30b_shared", attnId: "sarvam_30b_attn" }, |
| 22 | +]; |
| 23 | + |
| 24 | +for (const { preset, mlpId, attnId } of ENTRIES) { |
| 25 | + test(`G16: ${preset} activation mutation propagates`, async ({ page }) => { |
| 26 | + test.setTimeout(60_000); |
| 27 | + await gotoApp(page); |
| 28 | + await selectPreset(page, preset); |
| 29 | + await page.locator(`[data-testid='brick-node-${mlpId}']`).click(); |
| 30 | + const panel = page.getByTestId(`brick-context-${mlpId}`); |
| 31 | + await expect(panel).toBeVisible({ timeout: 4_000 }); |
| 32 | + await page.locator(`[data-testid='brick-context-${mlpId}-activation']`) |
| 33 | + .selectOption("swiglu"); |
| 34 | + await page.locator(`[data-testid='brick-context-${mlpId}-apply']`).click(); |
| 35 | + await clickRunPipeline(page, "train"); |
| 36 | + const extras = await readTrainExtras(page); |
| 37 | + expect(extras.model_summary.mlp_activation).toBe("swiglu"); |
| 38 | + expect(extras.weight_delta_norm).toBeGreaterThan(0); |
| 39 | + await closeModal(page); |
| 40 | + }); |
| 41 | + |
| 42 | + test(`G16: ${preset} pre_norm mutation propagates`, async ({ page }) => { |
| 43 | + test.setTimeout(60_000); |
| 44 | + await gotoApp(page); |
| 45 | + await selectPreset(page, preset); |
| 46 | + await page.locator(`[data-testid='brick-node-${attnId}']`).click(); |
| 47 | + const panel = page.getByTestId(`brick-context-${attnId}`); |
| 48 | + await expect(panel).toBeVisible({ timeout: 4_000 }); |
| 49 | + await page.locator(`[data-testid='brick-context-${attnId}-pre-norm']`) |
| 50 | + .selectOption("layernorm"); |
| 51 | + await page.locator(`[data-testid='brick-context-${attnId}-apply']`).click(); |
| 52 | + await clickRunPipeline(page, "train"); |
| 53 | + const extras = await readTrainExtras(page); |
| 54 | + expect(extras.model_summary.attention_pre_norm).toBe("layernorm"); |
| 55 | + expect(extras.weight_delta_norm).toBeGreaterThan(0); |
| 56 | + await closeModal(page); |
| 57 | + }); |
| 58 | +} |
0 commit comments