Skip to content

refactor(fa2): expose a Python-free C runtime#145

Open
LiangSu8899 wants to merge 1 commit into
mainfrom
feat/fa2-native-c-runtime
Open

refactor(fa2): expose a Python-free C runtime#145
LiangSu8899 wants to merge 1 commit into
mainfrom
feat/fa2-native-c-runtime

Conversation

@LiangSu8899

@LiangSu8899 LiangSu8899 commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

  • move the existing vendored FA2 C entry points into a Python-free shared library
  • keep flash_rt_fa2 as a thin Python adapter over the same implementation
  • install the adapter and raw library as one relocatable package unit
  • centralize the existing C declarations in one shared header

Design boundaries

  • this is shared attention infrastructure, not model-specific runtime behavior
  • existing fvk_attention_fa2_fwd_* signatures and the compiled kernel matrix remain unchanged
  • the raw library is an internal native linkage boundary, not a new public versioned ABI
  • native and Python producers consume one implementation and one symbol set

Packaging

flash_rt_fa2 and libflashrt_fa2_raw.so must be installed in the same directory. Both use an $ORIGIN runtime search path. Deployments that copied only the Python extension must switch to the complete install unit.

Validation

  • isolated SM120 build of the raw library and Python adapter
  • expected C symbols exported with no unresolved Python or FA2 entry symbols
  • adapter dynamic dependency and $ORIGIN runtime paths verified
  • BF16 attention executed through the Python adapter on SM120
  • install-unit and import-without-upstream-FA2 smoke tests
  • diff contains no model semantics, private paths, environment details, or generated artifacts

Merge order

Merge this shared-infrastructure PR before #144. Rebase #144 afterward so the attention-owner change is reviewed and landed exactly once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant