Skip to content

feat(subsystembenchmarks): add per-case rapid_cache_cold and rapid_cache_warm bucket types - #1085

Merged
zhixiangli merged 16 commits into
fsspec:mainfrom
zhixiangli:feat/rapid-cache-subsystembenchmarks
Oct 7, 2026
Merged

zhixiangli merged 16 commits into
fsspec:mainfrom
zhixiangli:feat/rapid-cache-subsystembenchmarks

Conversation

@zhixiangli

@zhixiangli zhixiangli commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds rapid_cache_cold and rapid_cache_warm bucket types to the subsystem benchmark harness so data-loading and checkpointing benchmarks can run against per-case GCS Rapid Cache (Anywhere Cache) instances.

  • Per-case Rapid Cache lifecycle (dataloading/rapid_cache.py, dataloading/bucket.py, dataloading/configurator.py, checkpointing/configurator.py):
    • Extends BUCKET_TYPES with rapid_cache_cold (rccold) and rapid_cache_warm (rcwarm). Both create a regional bucket in spec.location and provision an Anywhere Cache in spec.zone via POST b/{bucket}/anywhereCaches (ingestOnWrite=False for rapid_cache_cold, ingestOnWrite=True for rapid_cache_warm), polling GET b/{bucket}/anywhereCaches/{zone} every 10s until state == "RUNNING" (default timeout 3600s).
    • On teardown, _delete calls POST b/{bucket}/anywhereCaches/{zone}/disable, removes all objects under the bucket, and suppresses errors on fs.rmdir(name) because GCS blocks bucket deletion during the 1-hour grace period after disabling an Anywhere Cache.
  • Cold single-round timing and Warm multi-pass warmup (dataloading/read_case.py, dataloading/rapid_cache.py, checkpointing/checkpoint_case.py):
    • run_read_case overrides rounds=1 when params.bucket_type == "rapid_cache_cold" so subsequent rounds on the same bucket (which hit the cache after Round 1's admit-on-first-miss) are not averaged into the cold measurement.
    • warm_if_needed (invoked before timed rounds in run_read_case and in run_checkpoint_case when "read" in params.scenario) runs when bucket_type == "rapid_cache_warm" on a gs:// prefix. It reads every object under the prefix in 16 MiB chunks across up to 16 threads for 2 passes (DEFAULT_WARMUP_PASSES = 2) with a 65s settle delay (DEFAULT_WARMUP_SETTLE_SECONDS = 65) after each pass, then invalidates the filesystem cache. This allows asynchronous admit-on-first-miss admission to finish for any shards not admitted during concurrent ingest() writes and separates warmup reads from the timed 60s Cloud Monitoring alignment window.
  • Cloud Monitoring amplification enrichment (dataloading/amplification.py):
    • When bucket_type is rapid_cache_cold or rapid_cache_warm and bucket-level network/sent_bytes_count and api/request_count both return None or 0.0 (when reads are served from the cache rather than origin bucket egress), enrich_csv normalizes both to 0.0 so --require-amplification succeeds.
    • Populates gcs_read_bytes, gcs_read_request_count, and gcs_read_amplification_ratio together only when both egress bytes and request count are non-None and ideal > 0.
  • CLI, Cloud Build, and schema (run.py, cloudbuild/subsystembenchmarks/*):
    • Requires --zone when --bucket-type is zonal, rapid_cache_cold, or rapid_cache_warm, and adds --rapid-cache-timeout (GCSFS_SUBSYSTEM_RAPID_CACHE_TIMEOUT, default 3600).
    • Updates subsystembenchmarks-cloudbuild.yaml to accept rapid_cache_cold and rapid_cache_warm, pass _RAPID_CACHE_TIMEOUT, increase the job timeout to 18000s (and SSH key TTL to 5h), and disable active Anywhere Caches before cleaning up case buckets in delete-buckets and cleanup-leaked-resources (scoped by regex to <prefix>-(regional|zonal|hns|rapid_cache_cold|rapid_cache_warm)-<8hex>-).
  • WebDataset default sweep (dataloading/webdataset/configs.yaml):
    • Parks {axis: "shard_size", file_count: 256, rows_per_file: 196, enabled: false} (the unbuffered 256-shard variant), changing the default enabled WebDataset sweep from 11 to 10 cases.

Tests

  • Unit tests for rapid_cache (test_rapid_cache.py), bucket lifecycle (test_bucket.py), run_read_case single-round cold override and warmup ordering (test_read_case.py), run_checkpoint_case warmup hook (test_checkpoint_case.py), amplification enrichment (test_amplification.py), configurator abbreviations (test_configurator.py, checkpointing/tests/test_configs.py, ray_pytorch/tests/test_configs.py), CLI/Cloud Build wiring (test_run_groups.py), and WebDataset default sweep count (webdataset/tests/test_configs.py).

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

Copy link
Copy Markdown
Contributor

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 introduces support for GCS Rapid Cache (Anywhere Cache) in the subsystem benchmarks by adding two new bucket types: rapid_cache_cold and rapid_cache_warm. It implements the lifecycle management of Anywhere Caches, including creation, polling for RUNNING state, warming for read scenarios, disabling, and cleaning up leaked caches and buckets in Cloud Build. Additionally, configuration schemas, benchmark runners, and tests have been updated to support these new cache types. There are no review comments, so I have no feedback to provide.

@zhixiangli zhixiangli changed the title Feat/rapid cache subsystembenchmarks feat(subsystembenchmarks): add per-case rapid_cache_cold and rapid_cache_warm bucket types Sep 29, 2026
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.25%. Comparing base (07427a2) to head (e2c5197).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1085      +/-   ##
==========================================
+ Coverage   90.11%   90.25%   +0.14%     
==========================================
  Files          16       16              
  Lines        3408     3458      +50     
==========================================
+ Hits         3071     3121      +50     
  Misses        337      337              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhixiangli
zhixiangli marked this pull request as ready for review September 29, 2026 09:52
@zhixiangli
zhixiangli force-pushed the feat/rapid-cache-subsystembenchmarks branch from b69dbb3 to 214f9ed Compare September 29, 2026 09:52
@zhixiangli
zhixiangli force-pushed the feat/rapid-cache-subsystembenchmarks branch from 214f9ed to 3b8fb41 Compare October 5, 2026 08:45
@zhixiangli
zhixiangli marked this pull request as draft October 7, 2026 01:49
…nd job timeout to 18000s

GCS Anywhere Cache creation LROs in us-central1-b occasionally take
33-42 minutes (2,001s-2,537s) to transition from CREATING to RUNNING,
exceeding the previous 1,800s timeout. Increase DEFAULT_TIMEOUT_SECONDS
and _RAPID_CACHE_TIMEOUT to 3600s and raise the Cloud Build job timeout
to 18000s (5h).
…epoch

Time one untouched-corpus epoch on the same VM, bucket and corpus before
warming, and publish its throughput plus the warm/paired-cold speedup.
Cross-build cold vs warm comparisons were dominated by VM variance.

Create both Rapid Cache types with ingestOnWrite=false so the paired cold
epoch is genuinely uncached, scrape per-window cache hit/miss bytes, and
flag warm rows whose hit ratio is below --min-warm-hit-ratio.
Both start a fresh DataLoader and pay worker spawn plus connection setup;
later warm rounds reuse persistent workers, so dividing by the warm mean
would credit the cache with setup savings it did not earn.
Round 1 of a persistent-worker DataLoader carried worker spawn, imports and
gcsfs auth/connection set-up (time to first batch 3.4-7 s on n2-standard-64)
that later rounds do not, and that varies by seconds between runs. Workers
now prime gcsfs with a metadata-only request and park at a gate before the
round barrier; round 1's clock and the gate open together. Start-up is
reported in dataset_build_time instead.
… hit-ratio column

Rapid Cache hits are reliable on n2 VMs (b/570794310 tracks the c4/c3
campus-placement issue), so drop the workarounds added for c4 and
cross-VM noise:

- Remove the paired same-VM cold epoch on rapid_cache_warm and its six
  rapid_cache_paired_cold_* / warm-first-round schema columns; warm runs
  again use ingestOnWrite=true, untimed warmup passes, then timed rounds.
- Remove the WebDataset worker start gate and gcsfs priming.
- Replace rapid_cache_hits.py, --min-warm-hit-ratio and the hit/miss byte
  columns with a best-effort rapid_cache_hit_ratio column filled by the
  existing amplification scrape, with no build gate.
- Hard-code the 3600 s Rapid Cache creation timeout instead of plumbing
  --rapid-cache-timeout through Cloud Build, the runner and the env.
- Simplify warm_if_needed to a single url_to_fs/find/open path.
@zhixiangli
zhixiangli force-pushed the feat/rapid-cache-subsystembenchmarks branch from 8c594fa to e2c5197 Compare October 7, 2026 11:30
@zhixiangli
zhixiangli marked this pull request as ready for review October 7, 2026 11:44
@zhixiangli
zhixiangli merged commit 9f5f05f into fsspec:main Oct 7, 2026
11 checks passed
@zhixiangli
zhixiangli deleted the feat/rapid-cache-subsystembenchmarks branch October 7, 2026 11:44
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.

2 participants