asyncGPU
trackgin program 'correctness' of gpus stems from the fact we have many different threads sharign program memory spaces ( on nvida, each thead has a lcoal space mem , shared register mem , shared mem , adn tensor mem ). wehn mutliple acces at the same time, we get read after write (raw) , write after read (war ) , and write after write (waw ) problems. conflicts are local only to the shared acces of the memory each threads are accessing, so correcntess needs to track conflicst with respect to the cells they actually touch only , or we risk oversyncronizing ( early 2026 llms -
synthreads() syncthreadsagain() syncdatacetner() syncwarp() syncelectricitygrids() sycnthreadsagainjustincase() ) .
war / waw are sycnornizaton conflicts - the writing thread needs to ensure it is not overwriting before hte other thread has read/ written the same mem area.
we can represetn these generigally with singal() and wait() , wiht x bytes tagging y threads , and each isntantiated coutner being explicitly referencabel throughout .
raw is a sync + also a mem ordering probelm . by ordering , i mean both threads need to share the same local view of the memspace where the conflict is. because of out of non deterministic insturciotn order, threads have different local views of the global memspaces at what are, in execution order programatically equivalent times. many of the werid looking semantics in the ptx isa, i.e , fence/ proxy / release / acquire / relax / release, relate to terminology about ordering. for raw , the read thread needs to ensure it 'acquires' in ptx terms, a refernce of the writ threads local view of the memstate it writes before reading, or we risk reading stale data. in my async primitive , i use snasphto( optional=memsapce) , and publish(optoinal = memspace, ) to refer to these.
actually catchign these , i come up wiht 2 registyies - map , at the ptx level all instrucitons to there dataflow ( flow ) , which needs to include all the exact addreses the op reads adn writes. the async model , it needs to describe all its singal / wait e.t.c effects, and i also have a conditional if check for fifo conditionals ( some tcgen pipeline ops are ordered, btu not asyncorosu with resepct to some oops but not others, i.e , accumulating mmas with respect ot otehrs ) .
once we actually have ops actually descirbe the writes, we need a memory tracker that derives all deps we need to care abotu wiht respect to correcntess - i output this in a .clobber file . we only need to track ops that actually have local acceses with respect ot other ops for htis .
if we get the core registreis right , the final checker is mostly just flattening the async registyr ops , and then finding violations per the .clobber file - the final outptu is a seirs
^1 becasue recent ml gpus rely on executing on a tensor core that doesnt map neetly to one 'thread' model , i use vthread (virtual thread ) and i thread, for real instructions