Skip to content

[Hicache]: Add E2E CI For 3FS-KVStore#10131

Merged
xiezhq-hermann merged 3 commits intosgl-project:mainfrom
hzh0425:test/3fs-mock-client
Sep 8, 2025
Merged

[Hicache]: Add E2E CI For 3FS-KVStore#10131
xiezhq-hermann merged 3 commits intosgl-project:mainfrom
hzh0425:test/3fs-mock-client

Conversation

@hzh0425
Copy link
Copy Markdown
Collaborator

@hzh0425 hzh0425 commented Sep 7, 2025

Motivation

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @hzh0425, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the testing infrastructure for the Hicache 3FS-KVStore backend. It introduces a new abstract client interface and a mock implementation, enabling robust end-to-end CI testing for the 3FS storage. The changes also involve refactoring existing E2E tests to clearly distinguish between file-based and 3FS-based backends, ensuring comprehensive and well-organized test coverage.

Highlights

  • HF3FS Client Abstraction: Introduced an abstract base class Hf3fsClient and a mock implementation Hf3fsMockClient to facilitate testing of the 3FS-KVStore.
  • Refactored HF3FS Client: The existing HF3FS client (previously client_hf3fs.py) has been renamed to hf3fs_usrbio_client.py and updated to inherit from the new abstract Hf3fsClient.
  • Dynamic Client Selection: A factory function create_hf3fs_client was added to storage_hf3fs.py to allow dynamic instantiation of either the real Hf3fsUsrBioClient or the Hf3fsMockClient based on configuration.
  • New E2E Tests for 3FS-KVStore: Comprehensive end-to-end CI tests for the 3FS-KVStore backend have been added, covering different memory layouts (layer-first, page-first) and accuracy, utilizing the new mock client.
  • Refactored Existing E2E Tests: The existing E2E tests for HiCache storage have been renamed to test_hicache_storage_file_backend.py and refactored to use a base mixin class, improving test structure and clarity.
  • Test Suite Updates: The main test runner run_suite.py has been updated to include the new 3FS backend tests and reflect the renamed file backend tests.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a great step towards improving the test coverage for the 3FS-KVStore. The refactoring to introduce an abstract Hf3fsClient with a mock implementation is well-done and enables robust end-to-end testing in CI. The new tests for the 3FS backend are a valuable addition.

My review focuses on a few areas to improve the correctness and maintainability of the new mock client and tests:

  • Ensuring thread safety in the mock client to prevent race conditions during tests.
  • Improving the validation logic in the mock client to better mirror the real implementation and catch potential issues early.
  • Clarifying the configuration for tests to avoid redundancy and confusion.

Overall, these are solid changes. Addressing the feedback will make the new testing infrastructure even more reliable.

Comment thread python/sglang/srt/mem_cache/storage/hf3fs/hf3fs_client.py
Comment thread python/sglang/srt/mem_cache/storage/hf3fs/hf3fs_client.py
Comment thread python/sglang/srt/mem_cache/storage/hf3fs/hf3fs_client.py
Comment thread test/srt/hicache/test_hicache_storage_3fs_backend.py
# Conflicts:
#	python/sglang/srt/mem_cache/storage/hf3fs/storage_hf3fs.py
@xiezhq-hermann xiezhq-hermann added the ready-to-merge The PR is ready to merge after the CI is green. label Sep 8, 2025
@xiezhq-hermann xiezhq-hermann merged commit ec99668 into sgl-project:main Sep 8, 2025
68 of 75 checks passed
MahmoudAshraf97 pushed a commit to MahmoudAshraf97/sglang that referenced this pull request Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge The PR is ready to merge after the CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants