mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-10 07:28:15 -05:00
* work * basic stuff * work * also reset * moving through time * cleanup * proper zoom * add livereload.js pip install livereload livereload tinygrad/viz * minor * fixed width, remove viewbox * bit of flexbox magic * show pid/tid * merge loops * min-height * redo some layout stuff * create cell groups * text is hard * javascript Math.min causes "Maximum call stack size" bert repro: VIZ=1 PYTHONPATH=. DEFAULT_FLOAT=HALF BS=66 GPUS=6 BERT_LAYERS=2 FUSE_ARANGE=1 MODEL=bert python3 examples/mlperf/model_train.py * fix recursion issue * no viz/server changes * fix test_viz * everything is a g * text is easy * no it's still hard * livereload+notes * height: 100% fixes the device bug * start canvas work * base canvas * take chrome's stuff * serve chrome's thing * fetch traces from get_profile * remove junk * remove some more * bring everything back again * dispatch resize events * base ticks * hook d3.zoom * zoom on the x axis * bring filter back, makes ctrl+drag possible * remove junk * Revert "remove junk" This reverts commit4987e7bec1. * draws something, the zooms aren't right * move to canvas * fix zooming * Revert "Revert "remove junk"" This reverts commit5aac2034fb. * space key resets zoom * Divide timelines by device on y axis * Show kernel names when the width allows * Clicking on kernel opens it in the kernel graph * remove livereload.js * reset diff * base diff: - fetch traceEvents - displayGraph - flexbox layout - rest of canvas * rescale in-place is faster, d3's rescaleX creates a copy * less * aesthetics * map names * first viz is profiler * this will work when i make canvas once * initial cleanups * factor out of loop * refactor + only show devices with events * properly align program rects * cleaner tick lines * padding * listen for resize * simple zoom * space more * i always end up making zoom globl * how is this ever allowed * clicking works again * back button goes back to the same zoom level * work * more work * bring that back * coloring work and simplify * black * keep perfetto button for comparison * better * ph===X * simplify history stuff * temp: handcoded * test: flamegraph style leveling * Revert "temp: handcoded" This reverts commitbdcd538e88. * disable flamegraph * group by pid * factor y and height out of render * now flamegraph is easy * livereload stuff * remove that * less
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
const { spawn } = require("child_process");
|
|
const puppeteer = require("puppeteer");
|
|
|
|
async function main() {
|
|
// ** start viz server
|
|
const proc = spawn("python", ["-u", "-c", "from tinygrad import Tensor; Tensor.arange(4).realize()"], { env: { ...process.env, VIZ:"1" },
|
|
stdio: ["inherit", "pipe", "inherit"]});
|
|
await new Promise(resolve => proc.stdout.on("data", r => {
|
|
if (r.includes("ready")) resolve();
|
|
}));
|
|
|
|
// ** run browser tests
|
|
let browser, page;
|
|
try {
|
|
browser = await puppeteer.launch({ headless: true });
|
|
page = await browser.newPage();
|
|
const res = await page.goto("http://localhost:8000", { waitUntil:"domcontentloaded" });
|
|
if (res.status() !== 200) throw new Error("Failed to load page");
|
|
const scheduleSelector = await page.waitForSelector("ul:nth-of-type(2)");
|
|
scheduleSelector.click();
|
|
await page.waitForSelector("rect");
|
|
await page.waitForFunction(() => {
|
|
const nodes = document.querySelectorAll("#nodes > g").length;
|
|
const edges = document.querySelectorAll("#edges > path").length;
|
|
return nodes > 0 && edges > 0;
|
|
});
|
|
} finally {
|
|
// ** cleanups
|
|
if (page != null) await page.close();
|
|
if (browser != null) await browser.close();
|
|
proc.kill();
|
|
}
|
|
}
|
|
|
|
main();
|