[Common] EP C API: version config structs and extend nvte_ep_prepare with total_recv_tokens_per_rank placeholder#3154
Conversation
Greptile SummaryThis PR versions the EP C API config structs (
Confidence Score: 5/5Safe to merge; the ABI versioning design is sound, all call sites have been updated, and the ignored placeholder is clearly annotated. The normalize_ep_config() logic correctly handles all struct_size cases, the frozen min_size constants preserve backward compatibility for future field additions, and the rename/pointer-conversion is consistently applied across JAX, PyTorch, and C++ test call sites. The only finding is a style-level duplication in test code that carries no correctness risk. No files require special attention. The PyTorch ep_prepare parameter name (token_counts) is intentionally left as-is pending a dependent PR. Important Files Changed
Reviews (3): Last reviewed commit: "Merge branch 'main' into ep-c-api" | Re-trigger Greptile |
There was a problem hiding this comment.
LGTM pending CI. I think for now the struct_size field is sufficient for versioning. I feel like we have a lot of structs that have needed versioning, so in future would be great for someone to align the C API with similar versioning functionality, like some VERSIONED_STRUCT macro. But out of scope for this PR
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
… test Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
|
/te-ci L1 |
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
|
/te-ci L1 |
…` with `total_recv_tokens_per_rank` placeholder (#3154) * versioning EP C configs Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com> * Rename EP prepare token_counts to recv_tokens_per_expert Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com> * Add total_recv_tokens_per_rank placeholder to nvte_ep_prepare Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com> * Adapt PyTorch EP binding to versioned nvte_ep C config API Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com> * Rename EP group config max_num_sms to num_comm_sms Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com> --------- Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Description
NVTEEpGroupConfig,NVTEEpLayerConfig) with a leadingstruct_sizefield and passes them by pointer, so fields can be added without breaking ABI.total_recv_tokens_per_rankplaceholder output tonvte_ep_preparefor future use (accepted, may be null, ignored for now).nvte_ep_prepareoutputtoken_countstorecv_tokens_per_expertfor clarity.Type of change
Checklist: