Skip to content

[fix] Fix custom_backend_meta related issue#47

Merged
0oshowero0 merged 3 commits intoAscend:mainfrom
dpj135:bugfix
Mar 20, 2026
Merged

[fix] Fix custom_backend_meta related issue#47
0oshowero0 merged 3 commits intoAscend:mainfrom
dpj135:bugfix

Conversation

@dpj135
Copy link
Copy Markdown
Contributor

@dpj135 dpj135 commented Mar 17, 2026

Description

Running TQ_TEST_BACKEND=Yuanrong pytest -s tests/e2e/test_e2e_lifecycle_consistency.py raise error.

Main Changes

  • Fix a bug where custom_backend_meta of extended_meta was missing in test_e2e_lifecycle_consistency.py::test_cross_shard_complex_update.
  • Fix a bug where KVStorageManager::put_data used outdated field_names of metadata.
  • Add a preventative parameter checks to KVStorageManager::put_data.

Other Infos

$ TQ_TEST_BACKEND=Yuanrong pytest -s tests/e2e/test_e2e_lifecycle_consistency.py

========================================================================================== short test summary info ===========================================================================================
FAILED tests/e2e/test_e2e_lifecycle_consistency.py::test_cross_shard_complex_update - RuntimeError: Error in clear operation: No strategy supports item of type NoneType: None. Available strategies: ['NPUTensorKVClientAdapter', 'GeneralKVClientAdapter']
================================================================================== 1 failed, 7 passed, 1 warning in 17.76s ===================================================================================
  • clear_partition still raises error in test_e2e_lifecycle_consistency.py::test_cross_shard_complex_update, because some keys generated by metadata were not put before.
  • We plan to support automatic startup of Yuanrong for tq.init().

@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

dpj135, thanks for your pull request. All authors of the commits have signed the CLA. 👍

Signed-off-by: dpj135 <958208521@qq.com>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Pass

dpj135, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@dpj135
Copy link
Copy Markdown
Contributor Author

dpj135 commented Mar 17, 2026

cc @0oshowero0

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves key/value backend put_data correctness when writing partial/new fields by deriving key generation from the actual TensorDict contents (rather than metadata.field_names), and updates E2E lifecycle coverage to exercise additional backend/config and updated metadata-fetch flow.

Changes:

  • Add batch-size consistency validation and generate KV keys using sorted data.keys() in KVStorageManager.put_data.
  • Map returned custom_backend_meta using the data-derived field ordering.
  • Extend E2E backend configurations with a Yuanrong option and adjust the cross-shard update test to re-fetch metadata for newly added fields.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
transfer_queue/storage/managers/base.py Generate KV keys from TensorDict fields and add batch-size validation in put_data; adjust custom-backend-meta mapping accordingly.
tests/e2e/test_e2e_lifecycle_consistency.py Add Yuanrong backend config and refactor metadata selection logic for new-field verification in cross-shard updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +81 to +92
"Yuanrong": {
"controller": {
"polling_mode": True,
},
"backend": {
"storage_backend": "Yuanrong",
"Yuanrong": {
"host": "127.0.0.1",
"port": 31501,
},
},
},
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore it temporarily

},
},
},
"Yuanrong": {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this test to github actions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In currently, Yuanrong-datasystem need to be started by hands. We plan to support automatic startup of Yuanrong for tq.init() in next PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#50

Signed-off-by: dpj135 <958208521@qq.com>

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Guide

@dpj135 , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
d5d9b08f Apply suggestions from code revi... the email used in the commit is not linked to a signed CLA!
please verify that it matches the email you used when signing the CLA.

To sign CLA, click here.

To check if your email is configured correctly, refer to the FAQs.

Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.

1 similar comment
@ascend-robot
Copy link
Copy Markdown

CLA Signature Guide

@dpj135 , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
d5d9b08f Apply suggestions from code revi... the email used in the commit is not linked to a signed CLA!
please verify that it matches the email you used when signing the CLA.

To sign CLA, click here.

To check if your email is configured correctly, refer to the FAQs.

Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.

Signed-off-by: dpj135 <958208521@qq.com>
@ascend-robot
Copy link
Copy Markdown

CLA Signature Guide

@dpj135 , thanks for your pull request.

The following commit(s) are not associated with a signed Contributor License Agreement (CLA).

Commit Reason
d5d9b08f Apply suggestions from code revi... the email used in the commit is not linked to a signed CLA!
please verify that it matches the email you used when signing the CLA.

To sign CLA, click here.

To check if your email is configured correctly, refer to the FAQs.

Once you've signed the CLA or updating your email, please comment /check-cla to revalidate CLA status.

@dpj135 dpj135 requested a review from 0oshowero0 March 20, 2026 01:16
@0oshowero0 0oshowero0 changed the title [bug] Fix some bugs [fix] Fix custom_backend_meta related issue Mar 20, 2026
@0oshowero0 0oshowero0 merged commit 77fce91 into Ascend:main Mar 20, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants