Windows 11 nativo + tier VRAM additivi: cascata heat-driven, FFN batc…#71
Windows 11 nativo + tier VRAM additivi: cascata heat-driven, FFN batc…#71nuspy wants to merge 1 commit into
Conversation
…iven, FFN batched, RAM dinamica Basato sul main aggiornato (include il port MinGW JustVugg#40, coli doctor JustVugg#33, scratch JustVugg#43) e riconciliato con essi: compat.h estende il layer _WIN32 esistente invece di sostituirlo, i nomi upstream (COMPAT_O_RDONLY, compat_aligned_free, compat_meminfo) sono il canone. ESTENSIONI AL PORT WINDOWS (target clang/MSVC accanto a MinGW) - compat.h: sezione !__MINGW32__ con gli shim che MinGW ha nativi e MSVC no (ssize_t, dirent, pthread_create, clock_gettime/QPC, usleep). - compat.h: posix_fadvise WILLNEED non e' piu' un no-op — thread di readahead dedicato (ring MPSC advisory) che ripristina l'overlap I/O-calcolo del readahead expert e del PILOT anche su Windows. - compat.h: compat_pread con offset `long long` (off_t su MSVC e' long a 32 bit e _FILE_OFFSET_BITS non lo allarga: wrap silenzioso oltre 4 GB). - compat.h: setenv via _putenv_s, non SetEnvironmentVariableA — quella non aggiorna la copia CRT letta da getenv, e libomp legge OMP_WAIT_POLICY da li'. - build_win.ps1: build clang + nvcc dentro vcvars64 (toolset <=14.4x, senza -std: con MSVC 14.5x cudafe++ crasha, CUDA 13.1); l'obj nvcc si linka direttamente nel motore clang — O_DIRECT e tier VRAM attivi su Windows. - st.h: guard unistd/dirent per il target MSVC; coli: rilevamento CUDA dalla import table PE, build via ps1 senza make; resource_plan: MemAvailable via GlobalMemoryStatusEx (ctypes); test_doctor: skip del test chmod su Windows. TIER GPU - VRAM senza backing RAM: gli slot pinnati caricati in VRAM liberano la copia host (tier ADDITIVI); su errore CUDA demozione rumorosa con ricarica da disco. Fix in coli_cuda_tensor_upload: il riuso di un tensore residente non richiede piu' i puntatori host. - FFN expert fusa e batched (gate->SiLU*up->down) su stream asincrono per device, in overlap con gli expert CPU dello stesso blocco; staging pinned; CUDA_FFN=0 per l'A/B. Fixture 313M: cuda_pin 45->61 tok/s (+35-40%, 12 run interleaved); cuda_pin_dense 13.3 tok/s vs 2.4-4.5 cpu_stream. - Allocatore a cascata heat-driven in pin_load: banda VRAM (blocchi da 32, upload+free immediato, picco RAM ~1 blocco) -> banda RAM (PIN_GB) -> LRU; capienza totale RAM+VRAM; AUTOPIN parte anche con sola VRAM. Profili di dominio: COLI_PROFILE=<nome> -> storia separata .coli_usage.<nome>. - RAM dinamica: mem_watch_pass a ogni confine di turno (LRU shrink con evict reale sotto 3.5 GB liberi, grow sopra 6; MEMWATCH=0). Margine auto 12->10%, AUTOPIN 50->85% x confidenza. - resource_plan: tier VRAM limitato solo dalla VRAM fisica (niente clamp RAM). Test: 27+2 python (1 skip motivato su Windows) + 3 C + cuda-test verdi; oracolo TF 32/32 in tutte le combinazioni (CPU, CUDA, cascata, batched, sincrono). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
62501e3 to
d7a5009
Compare
|
First — this is a lot of genuinely good engineering (the dynamic RAM
So as-is this is CONFLICTING against main and would collide with #68. I don't want to lose the parts that are genuinely yours and new — the dynamic-RAM watcher and domain profiles especially are things neither #40 nor #68 do. The ask: could you rebase on current main and split this into just the net-new pieces — (a) |
|
Good news from a real Windows validation: I installed a MinGW-w64 cross-compiler and built this branch's CPU-only One blocker before it can land: this branch is based on an older |
|
Heads up: the CPU-portability half of the native-Windows port just landed in Your PR overlaps that now, so to avoid duplicate/conflicting work: if there's anything here #131 doesn't cover — a different GPU-DLL approach, additional tiers, extra fixes — a rebase onto current |
rajpratham1
left a comment
There was a problem hiding this comment.
Thanks for the substantial contribution. This PR adds Windows native support, CUDA integration, asynchronous FFN execution, compatibility layer changes, build tooling, and extensive runtime modifications.
Before this can be merged, I think additional validation is needed:
- Please split the work into smaller, reviewable PRs where possible (Windows compatibility, CUDA runtime changes, FFN pipeline, documentation, etc.). The current PR is difficult to review and increases merge risk.
- Add CI coverage for the new Windows build path and CUDA-enabled configuration so future changes don't unintentionally break these platforms.
- The new asynchronous FFN pipeline and VRAM tier introduce complex execution and memory-management behavior. Please include tests covering failure paths, synchronization, and fallback behavior to ensure correctness.
- The README describes benchmark improvements and new runtime capabilities. Including reproducible benchmark methodology and validation results would help reviewers verify these claims.
The overall direction looks valuable, but I'd like to see the implementation validated and broken into more manageable pieces before approving.
|
Could you rewrite this against current It's 213 commits behind Yours is the oldest and the furthest gone. Six Windows PRs merged this week (#275-279, #290, #302, #314) — some of what you built is probably already in, and the rest needs to be re-expressed against a tree that moved a long way. Worth checking what's left of your delta before you spend the time. What changed under you, which makes a rewrite cheaper than it sounds:
What would help it land fast: the smallest version that does one thing. A 300–700 line PR touching If you'd rather not, say so and I'll close it with thanks — no hard feelings either way. And if you think I've misjudged and it should go in as-is, push back: I've been wrong twice today already and both times a contributor caught it. |
|
Closing this one, with thanks and a clear reason rather than a silent stale-out. It's 263 commits behind That's this repo's triage failing you (the backlog grew faster than review), not your work. If there's a specific behavior in your heat-driven cascade or FFN batching that the current VRAM tier still lacks, a small focused PR against today's |
…hed, RAM dinamica
PORT WINDOWS NATIVO (validato token-exact: oracolo TF 32/32, CPU e CUDA su RTX 5090)
TIER GPU (fasi 1-4)
Test: 27 python + 3 C + cuda-test verdi; oracolo TF 32/32 in tutte le combinazioni (CPU, CUDA, pin RAM, pin VRAM-only, batched e sincrono).
Summary
Describe the problem and the smallest change that solves it.
Validation
make -C c checkmake -C c cuda-test(if applicable)Compatibility