Skip to content

fix(flexkv): set kv_dim instead of assigning ModelConfig.use_mla - #537

Merged
shijieliu merged 8 commits into
NVIDIA:mainfrom
Clebrate:fix/flexkv-use-mla-kv-dim
Nov 10, 2026
Merged

shijieliu merged 8 commits into
NVIDIA:mainfrom
Clebrate:fix/flexkv-use-mla-kv-dim

Conversation

@Clebrate

@Clebrate Clebrate commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Description

After #498 pinned FlexKV to 80edd846, ModelConfig.use_mla is a read-only property derived from kv_dim (use_mla == (kv_dim == 1)). Recsys still assigned model_config.use_mla = False, which crashes:

AttributeError: property 'use_mla' of 'ModelConfig' object has no setter

The two AOTI FlexKV server entry points now set kv_dim = 2 (separate K/V, same meaning as the old use_mla = False). KVCache manager tests map yaml use_mla / kv_dim the same way.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

FlexKV 80edd846 made use_mla a derived property of kv_dim, so
use_mla = False crashes AOTI export and the FlexKV server used by CI.
@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

The PR updates FlexKV configuration calls and pins a revision that loads optional Mooncake helpers only when needed.

  • HSTU FlexKV servers now build model settings with kv_dim and RankInfo.

Reviews (8) · Last reviewed commit: "fix(flexkv): pin cpp_client lazy mooncak..." · Reviewed by Greptile

@Clebrate

Clebrate commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

/build

@JacoCheung

JacoCheung commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

❌ Pipeline #79366655 -- failed

Job Status Log
pre_check ❌ failed view
train_build_x86 ✅ success view
train_build_arm64 ✅ success view
prepare-jet-b200-smoke ✅ success view
prepare-jet-b200-inference ✅ success view
prepare-jet-cw-dfw-e2e-benchmark ✅ success view
build_whl ✅ success view
dynamicemb_test_fwd_bwd_8gpus ✅ success view
dynamicemb_test_load_dump_8gpus ✅ success view
unit_test_1gpu_a100 ✅ success view
unit_test_1gpu_h100 ❌ failed view
unit_test_4gpu ✅ success view
unit_test_tp_4gpu ❌ failed view
L20_unit_test_1gpu ✅ success view
inference_unit_test_1gpu ✅ success view
inference_test_1gpu ❌ failed view
inference_test_nve_2605_1gpu ❌ failed view

Result: 12/17 jobs passed

View full pipeline

FlexKV 80edd846 takes RankInfo as the first argument. The AOTI FlexKV
server helpers still passed ModelConfig, which fails right after kv_dim.
FlexKV 80edd846 no longer accepts total_clients; AOTI server startup
failed immediately after the RankInfo config update.
@Clebrate

Clebrate commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

/build

@JacoCheung

JacoCheung commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

❌ Pipeline #79372389 -- failed

Job Status Log
pre_check ❌ failed view
train_build_x86 ✅ success view
train_build_arm64 ✅ success view
prepare-jet-b200-smoke ✅ success view
prepare-jet-b200-inference ✅ success view
prepare-jet-cw-dfw-e2e-benchmark ✅ success view
build_whl ✅ success view
dynamicemb_test_fwd_bwd_8gpus ✅ success view
dynamicemb_test_load_dump_8gpus ✅ success view
unit_test_1gpu_a100 ✅ success view
unit_test_1gpu_h100 ❌ failed view
unit_test_4gpu ✅ success view
unit_test_tp_4gpu ❌ failed view
L20_unit_test_1gpu ✅ success view
inference_unit_test_1gpu ✅ success view
inference_test_1gpu ❌ failed view
inference_test_nve_2605_1gpu ❌ failed view

Result: 12/17 jobs passed

View full pipeline

Keep the recsys AOTI FKAO decoder from 0a732058 and pick up
CacheConfig.layer_granularity from taco NVIDIA#309. SHA lives on
Clebrate/FlexKV recsys/cpp-client-80edd846 until taco-project
has the same commit.
Comment thread third_party/FlexKV Resolved
Point at taco-project/FlexKV#324 (f255ffc): FKAO decode on current
main, including layerwise 80edd846. Replaces the cpp_client merge
SHA that taco cannot fetch until a collaborator pushes it.
FlexKV cpp_client HEAD 6a8703d is AOTI FKAO on top of current main
(including layerwise NVIDIA#309). Replaces the taco-main-only pin from NVIDIA#324.
cpp_client first parent is AOTI 0a732058; second parent is taco main
d4a37da (layerwise NVIDIA#309). SHA b97237f.
Point third_party/FlexKV at e25e05a so KVServer no longer imports
requests via mooncake_store_utils. AOTI/layerwise unchanged.
@shijieliu
shijieliu merged commit 2f80621 into NVIDIA:main Nov 10, 2026
1 check passed
shijieliu added a commit to shijieliu/recsys-examples that referenced this pull request Nov 12, 2026
Merge main up to 476cdc0: NVIDIA#544 and NVIDIA#547 in DynamicEmb; NVIDIA#535, NVIDIA#537,
NVIDIA#539 and NVIDIA#540 outside it.

- NVIDIA#544 deduplicates int32 keys as int64 in _dedup_indices and returns
  them in the input's dtype, as this branch did. The merge keeps main's
  widening (indices_64bit) and drops this branch's copy of it, so the
  keys are widened once. It keeps this branch's structure: a sharding on
  the hierarchical dist keeps its unique keys sized on the device, and
  TorchRec's dists slice them to the count. The docstring says both.
- NVIDIA#544 also bucketizes an int32 key as the int64 key of its value. The
  hierarchical dist's own bucketize still reads a key in its own width;
  the next commit gives it int32 keys as int64.
- DynamicEmb_APIs.md: main's paragraph on how the rules read a key, then
  this branch's line that the hierarchical dist takes roundrobin and
  hash_roundrobin only.
- test_sequence_embedding_fw.py and test_twin_module.py: main's int32
  runs (NVIDIA#544) and no-grad forward (NVIDIA#547), with this branch's checks that
  a sharding took the dist it was given (check_path, check_totals).
- NVIDIA#547 (a no-grad training forward releases its slot pins, after
  refreshing its slots past a rehash) merges without conflicts next to
  this branch's row map and load_from_flat_by.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

3 participants