tensorfs 0.3.87__tar.gz → 0.3.89__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tensorfs might be problematic. Click here for more details.
- {tensorfs-0.3.87 → tensorfs-0.3.89}/Cargo.lock +3 -3
- {tensorfs-0.3.87 → tensorfs-0.3.89}/Cargo.toml +1 -1
- {tensorfs-0.3.87 → tensorfs-0.3.89}/PKG-INFO +1 -1
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/download.rs +3 -2
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/tests.rs +19 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/source_download.rs +3 -5
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/API.md +48 -16
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/Cargo.toml +4 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/cuda.rs +2 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/cursor.rs +12 -8
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/device.rs +52 -19
- tensorfs-0.3.89/crates/tensorfs-plane/src/faults.rs +94 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/host.rs +166 -58
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/lib.rs +1 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/plane.rs +111 -47
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/tests/gpu.rs +190 -4
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/tests/host_tier.rs +124 -6
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-py/src/plane.rs +18 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/pyproject.toml +1 -1
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/plane.py +4 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/plane.pyi +9 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/Cargo.toml +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/build.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/examples/h3-swiglu-layout.md +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/examples/optional-cache-backfill.md +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/examples/resident-conversion.md +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/examples/resident_conversion_profile.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/asset_update.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/b64.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/ckpt.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/conform.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/ensure.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/fetch.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/ingest.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/main.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/rd.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/repo.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/snap.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/bin/tfs/watch.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/cache_roots.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/canon.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/capability.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/catalog/lock.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/catalog.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/cbor.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/checkpoint.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/checkpoint_root.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/corpus.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/adoption.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/companion_tests.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/estimate.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/graft_tests.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/group_commit_tests.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/history_cost_tests.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/part_rows_tests.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/progress.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/resume_tests.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/retention.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived/roots.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/derived.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/descriptors.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/disk.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/dtype.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/durability.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ensure/admission.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ensure/flight.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ensure.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/err.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/fetch.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/filesystem_identity.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/fill.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/fit.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/gc.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/header.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/home.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ids.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/carrier.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/convert.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/custody.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/fingerprint.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/gguf.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/h3_lora.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/journal.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/mod.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/narrow.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/preflight.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/routes/anima.routes.json +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/routes/anima.spec.json +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/routes/sdxl.routes.json +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/routes/sdxl.spec.json +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/routes.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/source.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/stamp.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/ingest/transaction.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/jcs.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/keyed_roots.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/lib.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/limits.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/machine.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/manifest.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/meta.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/project.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/providers.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/read.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/receipt.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/reclaim.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/registry.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/relation.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/repo_cache.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/repository.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/sha256.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/source_artifact.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/spec.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/staging.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/stats.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/storage.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/store.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/api.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/decisions.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/http.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/http_reuse_tests.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/hub.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/ledger.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/memory.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/mod.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/policy.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/pull.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/push.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/sources.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/transport/tests/tail.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/unsynced.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/src/vectors.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/additive_fields.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/anima_hf_profile.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/as_is.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/catalog_owner_probe.c +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/checkpoint_roots.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/civitai_anima.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/civitai_sdxl_profile.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/ensure.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fd_budget.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fd_headroom.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fetch_faults.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fetch_url_progress.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fit.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fixtures/repo_apply/blobs.jsonl +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_list.jsonl +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_repository.json +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fixtures/repo_apply/expected_rows.jsonl +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fixtures/repo_apply/header.cbor +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fixtures/repo_apply/manifest.json +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/fixtures/repo_apply/mutation.json +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/foreign_json.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/h3_lora.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/h3_swiglu.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/home.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/hub_tls.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/import_tree.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/instrument_profiles.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/keyed_roots.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/liveness.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/qwen_image21_profile.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/read_plan.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/reclaim.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/reclaim_run.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/repo_cache.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/repo_store.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/resident_admission.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/routed_single_file.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/sha256_backends.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/sharded_cas.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/source_artifacts.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/source_plan.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/source_prefixes.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/source_preflight.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/staging.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/store_boundaries.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/tensor_schema.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/transfer_memory.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/trust_index.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/version.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-core/tests/write_through.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/bin/g1_vmm.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/bin/g2_overlap.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/bin/gpu_bench/mod.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/io.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/src/layout.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-plane/tests/common/mod.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-py/Cargo.toml +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-py/src/docs.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-py/src/ensure.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-py/src/errors.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-py/src/ingest.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-py/src/lib.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/crates/tensorfs-py/src/store.rs +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/__init__.py +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/_derived_channel.py +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/_ext.pyi +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/_source_channel.py +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/_tensors.py +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/derived.py +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/errors.py +0 -0
- {tensorfs-0.3.87 → tensorfs-0.3.89}/python/tensorfs/py.typed +0 -0
|
@@ -449,7 +449,7 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
|
449
449
|
|
|
450
450
|
[[package]]
|
|
451
451
|
name = "tensorfs-core"
|
|
452
|
-
version = "0.3.
|
|
452
|
+
version = "0.3.89"
|
|
453
453
|
dependencies = [
|
|
454
454
|
"fs2",
|
|
455
455
|
"libc",
|
|
@@ -464,7 +464,7 @@ dependencies = [
|
|
|
464
464
|
|
|
465
465
|
[[package]]
|
|
466
466
|
name = "tensorfs-plane"
|
|
467
|
-
version = "0.3.
|
|
467
|
+
version = "0.3.89"
|
|
468
468
|
dependencies = [
|
|
469
469
|
"libc",
|
|
470
470
|
"libloading",
|
|
@@ -474,7 +474,7 @@ dependencies = [
|
|
|
474
474
|
|
|
475
475
|
[[package]]
|
|
476
476
|
name = "tensorfs-py"
|
|
477
|
-
version = "0.3.
|
|
477
|
+
version = "0.3.89"
|
|
478
478
|
dependencies = [
|
|
479
479
|
"pyo3",
|
|
480
480
|
"tensorfs-core",
|
|
@@ -715,7 +715,8 @@ impl Run<'_> {
|
|
|
715
715
|
let job = self.job;
|
|
716
716
|
let object = &chunk.object;
|
|
717
717
|
let wanted = &object.grant.object;
|
|
718
|
-
//
|
|
718
|
+
// A Hub object that is one chunk is one plain GET. A source request always names its
|
|
719
|
+
// range: a 206 is how the origin says it ranges, and its stand-ins answer only ranges.
|
|
719
720
|
let whole = chunk.first == 0 && chunk.end == wanted.length;
|
|
720
721
|
let range = [(
|
|
721
722
|
"range".to_string(),
|
|
@@ -729,7 +730,7 @@ impl Run<'_> {
|
|
|
729
730
|
job.credential,
|
|
730
731
|
job.deadline,
|
|
731
732
|
ledger,
|
|
732
|
-
if whole { &[] } else { &range },
|
|
733
|
+
if whole && job.ranged { &[] } else { &range },
|
|
733
734
|
&mut |checked, _| hops.push(checked.url()),
|
|
734
735
|
)?;
|
|
735
736
|
// A redirect target that refuses is forgotten, and the object's URL asked again.
|
|
@@ -3733,6 +3733,25 @@ fn a_source_object_crosses_in_parallel_byte_ranges() {
|
|
|
3733
3733
|
assert_eq!(temps(&source.root), 0);
|
|
3734
3734
|
}
|
|
3735
3735
|
|
|
3736
|
+
/// A source object no larger than one request is still asked for by range, as every source
|
|
3737
|
+
/// fetch before 0.3.87 was: an origin that answers only ranges serves it.
|
|
3738
|
+
#[test]
|
|
3739
|
+
fn a_small_source_object_is_asked_for_by_range() {
|
|
3740
|
+
let body = ranged_body(300 << 10);
|
|
3741
|
+
let served = body.clone();
|
|
3742
|
+
let source = Source::new("ranged-small", &body, move |request| {
|
|
3743
|
+
match range_of(request) {
|
|
3744
|
+
Some(_) => partial(&served, request),
|
|
3745
|
+
None => status(400, b"a range is required"),
|
|
3746
|
+
}
|
|
3747
|
+
});
|
|
3748
|
+
let fetched = source.fetch(4, &local_policy()).unwrap();
|
|
3749
|
+
|
|
3750
|
+
assert_eq!(fetched.transferred, source.object.length);
|
|
3751
|
+
assert!(source.held());
|
|
3752
|
+
assert_eq!(source.asked(), vec![format!("bytes=0-{}", body.len() - 1)]);
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3736
3755
|
/// A source that will not range must still work: the first chunk's ask is answered with
|
|
3737
3756
|
/// the whole object, and that one request is the object.
|
|
3738
3757
|
#[test]
|
|
@@ -447,11 +447,9 @@ fn a_connection_cut_mid_body_resumes_at_the_byte_it_reached() {
|
|
|
447
447
|
let bytes = body(9, 5 * MIB + 1);
|
|
448
448
|
let length = bytes.len() as u64;
|
|
449
449
|
// The first delivery answer dies 2.5 MiB in; the next ask must start there.
|
|
450
|
-
let origin = Origin::start(vec![(name, bytes)], 0, |request, _| {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
false => Act::Serve,
|
|
454
|
-
}
|
|
450
|
+
let origin = Origin::start(vec![(name, bytes)], 0, |request, _| match request.range {
|
|
451
|
+
Some((0, _)) if request.path.starts_with("/cdn/") => Act::Cut(5 * MIB / 2),
|
|
452
|
+
_ => Act::Serve,
|
|
455
453
|
});
|
|
456
454
|
let dir = root("cut");
|
|
457
455
|
let store = Store::init(&dir).unwrap();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# tensorfs.plane — Python API (v3, 2026-
|
|
1
|
+
# tensorfs.plane — Python API (v3.1, 2026-10-02)
|
|
2
2
|
|
|
3
3
|
The weight plane moves bytes; cozy-runtime decides. The plane never measures free memory,
|
|
4
4
|
never picks victims among equals, never reorders a schedule. It ships inside the `tensorfs`
|
|
@@ -48,13 +48,17 @@ ws = p.register(
|
|
|
48
48
|
regions, # list[list[str]]: region r = tensor ids "component/key" (all roles)
|
|
49
49
|
# or exact parts "component/key#role"; every plan part in exactly
|
|
50
50
|
# one region; a region's parts keep plan order; no empty region
|
|
51
|
-
host_fd=None, # adopt a memfd holding this layout (another process's pinned tier)
|
|
51
|
+
host_fd=None, # adopt a memfd holding this layout (another process's pinned tier);
|
|
52
|
+
# every region already Ready in it joins this plane's books at
|
|
53
|
+
# once (claimed, counted in `used`, lowest priority)
|
|
52
54
|
)
|
|
53
55
|
ws.name, ws.nbytes # nbytes = layout span (multiple of 2 MiB)
|
|
54
56
|
ws.regions # [{"index", "offset", "nbytes", "span"}]
|
|
55
57
|
ws.parts # [{"what": "comp/key#role", "region", "offset", "nbytes"}]
|
|
56
|
-
ws.host_fd # the memfd (plane-owned); pass to another
|
|
57
|
-
|
|
58
|
+
ws.host_fd # the memfd (plane-owned, an unlocked description); pass it to another
|
|
59
|
+
# process to share the tier
|
|
60
|
+
ws.close() # refuses while leases, holds, cursors or views remain; punches the
|
|
61
|
+
# pinned RAM no other process claims (see Host tier across processes)
|
|
58
62
|
```
|
|
59
63
|
|
|
60
64
|
Binding a part: `base[part.offset - region.offset : ... + nbytes]` of the region's bytes,
|
|
@@ -111,7 +115,8 @@ lease = p.acquire(ws, device, region, stream, priority=None)
|
|
|
111
115
|
lease.ptr, lease.nbytes, lease.region, lease.ring_offset # ring_offset is None for resident leases
|
|
112
116
|
lease.view() # ONE uint8 DLPack view of the region's bytes (see Views)
|
|
113
117
|
lease.verify_bytes() # diagnostic: parts whose device bytes differ from the source
|
|
114
|
-
# (waits for the copy, reads the store; debugging runs only)
|
|
118
|
+
# (waits for the copy, reads the store; debugging runs only);
|
|
119
|
+
# Invalid after release
|
|
115
120
|
lease.release() # records the release event on the acquire stream (or pass stream=)
|
|
116
121
|
with p.acquire(ws, device, region, stream) as lease: ...
|
|
117
122
|
```
|
|
@@ -227,28 +232,55 @@ attributes: `BudgetExceeded` (`pool`, `requested`, `available`), `Shortfall` (`p
|
|
|
227
232
|
`pool == "device"` means the driver itself had no memory left (the budget exceeds what is
|
|
228
233
|
free): lower it.
|
|
229
234
|
|
|
230
|
-
**
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
235
|
+
**A failed copy leaves nothing in flight.** A fill or ring copy that fails after enqueuing part
|
|
236
|
+
of its work is reported (its ticket, `acquire`, `fill_failed`) only after the copy stream has
|
|
237
|
+
drained, so unmapping, dropping or closing what it touched is safe at once. A failure the
|
|
238
|
+
stream cannot drain is `Poisoned`.
|
|
239
|
+
|
|
240
|
+
**Poison is latched plane-wide**: an ambiguous driver outcome (a failed unmap or rollback, an
|
|
241
|
+
undrainable copy failure, a driver mapping that disagrees with the books) or a lease dropped
|
|
242
|
+
unreleased makes every later call raise `Poisoned` with the first cause; the runtime replaces
|
|
243
|
+
the executor. A poisoned plane never unmaps, unregisters or frees a range (copies may still
|
|
244
|
+
touch it): `ws.close()`, `cur.close()` and `p.close()` raise `Poisoned` and the process keeps
|
|
245
|
+
the ranges until it exits. Capacity never poisons (`BudgetExceeded`, `Shortfall` leave the
|
|
246
|
+
plane usable).
|
|
234
247
|
|
|
235
248
|
## Host tier across processes
|
|
236
249
|
|
|
237
250
|
- One memfd per weight set, laid out exactly like the weight set, with a state page at its
|
|
238
|
-
end: a layout digest
|
|
251
|
+
end: a layout digest, one Ready word and the extent of each region. That page IS the shared
|
|
252
|
+
index.
|
|
253
|
+
- **Claims.** A process holds a shared OFD lock on a region's word for as long as the region is
|
|
254
|
+
filling or ready in its books. Evicting, dropping or closing ends this process's claim; the
|
|
255
|
+
last claimant punches the region's RAM. So pinned RAM is always inside some live budget, a
|
|
256
|
+
closed set does not stay resident because another process kept the fd, and no process loses
|
|
257
|
+
pages it still has registered. The kernel drops a dead process's claims.
|
|
239
258
|
- `register(..., host_fd=fd)` in another process (or a replacement executor) reopens the fd
|
|
240
|
-
(its own open file description), refuses a different layout digest, and
|
|
241
|
-
|
|
242
|
-
|
|
259
|
+
(its own open file description), refuses a different layout digest, and claims every region
|
|
260
|
+
whose Ready word is set — registering it, reading nothing (`stats()["host"]["fill_bytes"]`
|
|
261
|
+
unchanged) — at the lowest priority, counted in `used`. The digest covers the plan's parts,
|
|
243
262
|
their object ranges and the region grouping: register with the same plan and regions.
|
|
263
|
+
- `ws.host_fd` is a separate, never-locked description: a process that keeps it (or a dup) keeps
|
|
264
|
+
the memfd alive but no claim.
|
|
265
|
+
- **Keeping a tier without a plane** (the Worker between executors): `h = plane.hold_tier(fd)`
|
|
266
|
+
claims every region (one shared lock over the whole file, on a new description); while it is
|
|
267
|
+
held, no plane eviction or close punches the tier. `plane.release_tier(h)` closes it and punches
|
|
268
|
+
every Ready region no plane claims, returning the bytes punched. Bound held tiers with the
|
|
269
|
+
holder's own budget (`os.fstat(fd).st_blocks * 512` is the memfd's RAM).
|
|
244
270
|
- A host-only `Plane(devices=[])` (never loads libcuda) can fill a tier before any executor
|
|
245
271
|
holds a GPU; executors adopt and register it.
|
|
246
|
-
-
|
|
247
|
-
|
|
248
|
-
from pages it registered before a punch reads the same bytes.
|
|
272
|
+
- A memfd from a plane before v3.1 (state page `TFSPLN01`) is a different layout: adopting it
|
|
273
|
+
raises `Invalid`; register a fresh one.
|
|
249
274
|
|
|
250
275
|
## Changelog
|
|
251
276
|
|
|
277
|
+
- v3.1 2026-10-02 (Xid 31; W3 run 2675): a failed copy is reported only after its stream drained;
|
|
278
|
+
an undrainable one poisons; a poisoned plane never unmaps (close raises `Poisoned`).
|
|
279
|
+
`verify_bytes()` after release raises `Invalid`. Pinned-tier claims: close and eviction punch
|
|
280
|
+
RAM no other process claims, `register(host_fd=)` claims what the memfd already holds,
|
|
281
|
+
`plane.hold_tier` / `plane.release_tier` for the Worker. The state page gains region extents
|
|
282
|
+
(`TFSPLN02`).
|
|
283
|
+
|
|
252
284
|
- v3 2026-09-30 (proving-cpu.md: fine regions, spread sets): streaming uses a byte ring
|
|
253
285
|
instead of fixed slots. `stream(..., ring_bytes=None)`; `cur.ring_ptr`, `cur.ring_nbytes`,
|
|
254
286
|
`cur.ring_view()` replace `slot_ptrs`, `slot_nbytes`, `slot_view(i)`; `lease.ring_offset`
|
|
@@ -105,6 +105,7 @@ pub struct Driver {
|
|
|
105
105
|
pub primary_ctx_retain: unsafe extern "C" fn(*mut CUcontext, CUdevice) -> CUresult,
|
|
106
106
|
pub ctx_get_current: F<*mut CUcontext>,
|
|
107
107
|
pub ctx_set_current: F<CUcontext>,
|
|
108
|
+
pub ctx_synchronize: unsafe extern "C" fn() -> CUresult,
|
|
108
109
|
pub stream_create: unsafe extern "C" fn(*mut CUstream, c_uint) -> CUresult,
|
|
109
110
|
pub stream_destroy: F<CUstream>,
|
|
110
111
|
pub stream_synchronize: F<CUstream>,
|
|
@@ -187,6 +188,7 @@ impl Driver {
|
|
|
187
188
|
primary_ctx_retain: load!(lib, b"cuDevicePrimaryCtxRetain"),
|
|
188
189
|
ctx_get_current: load!(lib, b"cuCtxGetCurrent"),
|
|
189
190
|
ctx_set_current: load!(lib, b"cuCtxSetCurrent"),
|
|
191
|
+
ctx_synchronize: load!(lib, b"cuCtxSynchronize"),
|
|
190
192
|
stream_create: load!(lib, b"cuStreamCreate"),
|
|
191
193
|
stream_destroy: load!(lib, b"cuStreamDestroy_v2"),
|
|
192
194
|
stream_synchronize: load!(lib, b"cuStreamSynchronize"),
|
|
@@ -93,6 +93,9 @@ impl Cur {
|
|
|
93
93
|
/// Queue copies for streamed positions, in order, while the window and the ring allow.
|
|
94
94
|
fn pump(inner: &Arc<Inner>, c: &mut Core, id: u64) -> Result<()> {
|
|
95
95
|
loop {
|
|
96
|
+
if c.poisoned.is_some() {
|
|
97
|
+
return Ok(()); // nothing new goes to a device whose state is ambiguous
|
|
98
|
+
}
|
|
96
99
|
let cur = c.cursors.get_mut(&id).ok_or(Error::Closed)?;
|
|
97
100
|
let k = cur.next_submit;
|
|
98
101
|
if cur.orphaned || k >= cur.streamed_total() || k - cur.done >= cur.window {
|
|
@@ -165,6 +168,9 @@ fn submit(inner: &Arc<Inner>, c: &mut Core, id: u64, k: u64, off: u64, waits: Ve
|
|
|
165
168
|
bytes: cp.bytes,
|
|
166
169
|
});
|
|
167
170
|
}
|
|
171
|
+
if let Err(e) = &res {
|
|
172
|
+
c.latch(e);
|
|
173
|
+
}
|
|
168
174
|
if let Some(cur) = c.cursors.get_mut(&id) {
|
|
169
175
|
cur.inflight -= 1;
|
|
170
176
|
cur.ready.insert(k, res.map(|cp| cp.ready));
|
|
@@ -213,18 +219,16 @@ fn reap(inner: &Arc<Inner>, c: &mut Core, id: u64) {
|
|
|
213
219
|
}
|
|
214
220
|
}
|
|
215
221
|
|
|
216
|
-
/// Unmap a cursor's ring and return its holds. No lease, view or copy in flight remains
|
|
222
|
+
/// Unmap a cursor's ring and return its holds. No lease, view or copy in flight remains (a
|
|
223
|
+
/// failed copy is drained before it is reported). A poisoned plane keeps the ring mapped.
|
|
217
224
|
fn finish(inner: &Arc<Inner>, c: &mut Core, id: u64) -> Result<()> {
|
|
225
|
+
c.check()?;
|
|
218
226
|
let cur = c.cursors.remove(&id).ok_or(Error::Closed)?;
|
|
219
227
|
let d = cur.dev;
|
|
220
228
|
let _g = inner.devices[d].bind()?;
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
for p in &cur.placed {
|
|
225
|
-
if let Some(Some(e)) = &p.freed {
|
|
226
|
-
e.sync()?;
|
|
227
|
-
}
|
|
229
|
+
let freed = cur.placed.iter().filter_map(|p| p.freed.as_ref().and_then(Option::as_ref));
|
|
230
|
+
if let Err(e) = cur.ready.values().flatten().chain(freed).try_for_each(|e| e.sync()) {
|
|
231
|
+
return Err(c.poison(format!("waiting for a ring's copies and readers failed: {e}")));
|
|
228
232
|
}
|
|
229
233
|
if cur.ring_len > 0 {
|
|
230
234
|
if let Err(e) = device::unmap_span(cur.ring_base, cur.ring_len) {
|
|
@@ -489,6 +489,10 @@ struct Waiter {
|
|
|
489
489
|
cv: Condvar,
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
+
/// One job on the mover's stream. `Err` means nothing this job enqueued is still in flight and
|
|
493
|
+
/// no reader still writes a bounce: a failed copy is drained before it is reported, so no
|
|
494
|
+
/// caller unmaps, unregisters or reuses a range a copy still touches. A drain that itself fails
|
|
495
|
+
/// is ambiguous device state: `Poisoned`.
|
|
492
496
|
fn run_copy(
|
|
493
497
|
m: &MoverCtx,
|
|
494
498
|
stream: CUstream,
|
|
@@ -497,6 +501,28 @@ fn run_copy(
|
|
|
497
501
|
dst: u64,
|
|
498
502
|
len: u64,
|
|
499
503
|
src: CopySrc,
|
|
504
|
+
) -> Result<Copied> {
|
|
505
|
+
let r = enqueue_copy(m, stream, bounces, waits, dst, len, src);
|
|
506
|
+
let Err(e) = r else { return r };
|
|
507
|
+
let d = cuda::driver()?;
|
|
508
|
+
// SAFETY: our own stream.
|
|
509
|
+
let drained = crate::faults::hit("drain").and_then(|_| {
|
|
510
|
+
cuda::check("cuStreamSynchronize", unsafe { (d.stream_synchronize)(stream) })
|
|
511
|
+
});
|
|
512
|
+
match drained {
|
|
513
|
+
Ok(()) => Err(e),
|
|
514
|
+
Err(drain) => Err(Error::Poisoned(format!("a failed copy ({e}) could not be drained: {drain}"))),
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
fn enqueue_copy(
|
|
519
|
+
m: &MoverCtx,
|
|
520
|
+
stream: CUstream,
|
|
521
|
+
bounces: &mut [Bounce],
|
|
522
|
+
waits: Vec<EvRef>,
|
|
523
|
+
dst: u64,
|
|
524
|
+
len: u64,
|
|
525
|
+
src: CopySrc,
|
|
500
526
|
) -> Result<Copied> {
|
|
501
527
|
let d = cuda::driver()?;
|
|
502
528
|
let start = m.events.get(true)?;
|
|
@@ -511,11 +537,13 @@ fn run_copy(
|
|
|
511
537
|
match src {
|
|
512
538
|
CopySrc::Host(p) => {
|
|
513
539
|
wait_all(&waits)?;
|
|
540
|
+
crate::faults::gate("copy", stream)?;
|
|
514
541
|
start.record(stream)?;
|
|
515
542
|
// SAFETY: `p` covers `len` bytes of the pinned tier, kept alive by the books.
|
|
516
543
|
cuda::check("cuMemcpyHtoDAsync", unsafe {
|
|
517
544
|
(d.memcpy_htod_async)(dst, p as *const libc::c_void, len as usize, stream)
|
|
518
545
|
})?;
|
|
546
|
+
crate::faults::hit("host-copy-recorded")?;
|
|
519
547
|
ready.record(stream)?;
|
|
520
548
|
Ok(Copied { ready, start, bytes: len, from_host: true })
|
|
521
549
|
}
|
|
@@ -528,14 +556,16 @@ fn run_copy(
|
|
|
528
556
|
let mut inflight: VecDeque<(u64, usize, Arc<Waiter>)> = VecDeque::new();
|
|
529
557
|
let mut next = 0usize;
|
|
530
558
|
// The slot's previous readers first: the stream waits, the host keeps reading.
|
|
531
|
-
wait_all(&waits)
|
|
559
|
+
let mut failed = wait_all(&waits).and_then(|_| crate::faults::gate("copy", stream)).err();
|
|
532
560
|
let mut first = true;
|
|
533
|
-
let mut failed = None;
|
|
534
561
|
loop {
|
|
535
562
|
while failed.is_none() && inflight.len() < bounces.len() && next < nchunks {
|
|
536
563
|
let b = next % bounces.len();
|
|
537
564
|
if let Some(last) = bounces[b].last.take() {
|
|
538
|
-
last.sync()
|
|
565
|
+
if let Err(e) = last.sync() {
|
|
566
|
+
failed = Some(e);
|
|
567
|
+
break;
|
|
568
|
+
}
|
|
539
569
|
}
|
|
540
570
|
let c0 = next as u64 * cap;
|
|
541
571
|
let c1 = (c0 + cap).min(len);
|
|
@@ -568,31 +598,34 @@ fn run_copy(
|
|
|
568
598
|
while g.is_none() {
|
|
569
599
|
g = w.cv.wait(g).unwrap();
|
|
570
600
|
}
|
|
571
|
-
// After
|
|
601
|
+
// After any failure keep draining: readers may still write the bounces.
|
|
572
602
|
if let Err(e) = g.take().unwrap() {
|
|
573
603
|
failed.get_or_insert(e);
|
|
574
604
|
}
|
|
575
605
|
if failed.is_some() {
|
|
576
606
|
continue;
|
|
577
607
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
608
|
+
let mut copy = || -> Result<()> {
|
|
609
|
+
if first {
|
|
610
|
+
start.record(stream)?;
|
|
611
|
+
first = false;
|
|
612
|
+
}
|
|
613
|
+
crate::faults::hit("staged-copy")?;
|
|
614
|
+
let n = cap.min(len - c0);
|
|
615
|
+
// SAFETY: the bounce holds the chunk; pinned host memory.
|
|
616
|
+
cuda::check("cuMemcpyHtoDAsync", unsafe {
|
|
617
|
+
(d.memcpy_htod_async)(dst + c0, bounces[b].ptr as *const libc::c_void, n as usize, stream)
|
|
618
|
+
})?;
|
|
619
|
+
let e = m.events.get(false)?;
|
|
620
|
+
e.record(stream)?;
|
|
621
|
+
bounces[b].last = Some(e);
|
|
622
|
+
Ok(())
|
|
623
|
+
};
|
|
624
|
+
if let Err(e) = copy() {
|
|
625
|
+
failed = Some(e);
|
|
581
626
|
}
|
|
582
|
-
let n = cap.min(len - c0);
|
|
583
|
-
// SAFETY: the bounce holds the chunk; pinned host memory.
|
|
584
|
-
cuda::check("cuMemcpyHtoDAsync", unsafe {
|
|
585
|
-
(d.memcpy_htod_async)(dst + c0, bounces[b].ptr as *const libc::c_void, n as usize, stream)
|
|
586
|
-
})?;
|
|
587
|
-
let e = m.events.get(false)?;
|
|
588
|
-
e.record(stream)?;
|
|
589
|
-
bounces[b].last = Some(e);
|
|
590
627
|
}
|
|
591
628
|
if let Some(e) = failed {
|
|
592
|
-
// Chunks before the failure are still writing the region: drain them, so an
|
|
593
|
-
// Invalid region never has a copy in flight when it is unmapped.
|
|
594
|
-
ready.record(stream)?;
|
|
595
|
-
ready.sync()?;
|
|
596
629
|
return Err(e);
|
|
597
630
|
}
|
|
598
631
|
if first {
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//! Fault points on the copy path, armed only by tests (cargo feature `faults`). Without the
|
|
2
|
+
//! feature every point is a no-op.
|
|
3
|
+
|
|
4
|
+
#[cfg(feature = "faults")]
|
|
5
|
+
mod imp {
|
|
6
|
+
use std::sync::atomic::{AtomicBool, Ordering};
|
|
7
|
+
use std::sync::{Arc, Mutex};
|
|
8
|
+
|
|
9
|
+
use crate::cuda::{self, CUstream};
|
|
10
|
+
|
|
11
|
+
static ARMED: Mutex<Vec<(&'static str, u64)>> = Mutex::new(Vec::new());
|
|
12
|
+
static GATES: Mutex<Vec<(&'static str, Arc<AtomicBool>)>> = Mutex::new(Vec::new());
|
|
13
|
+
|
|
14
|
+
/// Fail the `n`th (1-based) next pass through `point` as a driver out-of-memory. Replaces
|
|
15
|
+
/// any earlier arming of `point`.
|
|
16
|
+
pub fn arm(point: &'static str, n: u64) {
|
|
17
|
+
let mut a = ARMED.lock().unwrap();
|
|
18
|
+
a.retain(|(p, _)| *p != point);
|
|
19
|
+
a.push((point, n));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
pub(crate) fn hit(point: &'static str) -> crate::Result<()> {
|
|
23
|
+
let mut armed = ARMED.lock().unwrap();
|
|
24
|
+
let Some(i) = armed.iter().position(|(p, _)| *p == point) else { return Ok(()) };
|
|
25
|
+
armed[i].1 -= 1;
|
|
26
|
+
if armed[i].1 > 0 {
|
|
27
|
+
return Ok(());
|
|
28
|
+
}
|
|
29
|
+
armed.remove(i);
|
|
30
|
+
Err(crate::Error::Cuda { op: point, code: cuda::ERROR_OUT_OF_MEMORY, name: "injected".into() })
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/// Holds the next copy job's stream at `point` on the device until opened (or dropped).
|
|
34
|
+
pub struct Gate(Arc<AtomicBool>);
|
|
35
|
+
impl Gate {
|
|
36
|
+
pub fn open(&self) {
|
|
37
|
+
self.0.store(true, Ordering::Release);
|
|
38
|
+
}
|
|
39
|
+
pub fn is_open(&self) -> bool {
|
|
40
|
+
self.0.load(Ordering::Acquire)
|
|
41
|
+
}
|
|
42
|
+
pub fn opener(&self) -> impl FnOnce() + Send + 'static {
|
|
43
|
+
let f = self.0.clone();
|
|
44
|
+
move || f.store(true, Ordering::Release)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
impl Drop for Gate {
|
|
48
|
+
fn drop(&mut self) {
|
|
49
|
+
self.open();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
pub fn arm_gate(point: &'static str) -> Gate {
|
|
54
|
+
let f = Arc::new(AtomicBool::new(false));
|
|
55
|
+
GATES.lock().unwrap().push((point, f.clone()));
|
|
56
|
+
Gate(f)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
pub(crate) fn gate(point: &'static str, stream: CUstream) -> crate::Result<()> {
|
|
60
|
+
let f = {
|
|
61
|
+
let mut g = GATES.lock().unwrap();
|
|
62
|
+
let Some(i) = g.iter().position(|(p, _)| *p == point) else { return Ok(()) };
|
|
63
|
+
g.remove(i).1
|
|
64
|
+
};
|
|
65
|
+
extern "C" fn hold(p: *mut std::ffi::c_void) {
|
|
66
|
+
// SAFETY: the Arc leaked below, reclaimed exactly once here.
|
|
67
|
+
let f = unsafe { Arc::from_raw(p as *const AtomicBool) };
|
|
68
|
+
while !f.load(Ordering::Acquire) {
|
|
69
|
+
std::thread::sleep(std::time::Duration::from_millis(1));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
let d = cuda::driver()?;
|
|
73
|
+
let p = Arc::into_raw(f) as *mut std::ffi::c_void;
|
|
74
|
+
// SAFETY: our stream; the host function only waits on the flag.
|
|
75
|
+
cuda::check("cuLaunchHostFunc", unsafe { (d.launch_host_func)(stream, hold, p) })
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#[cfg(feature = "faults")]
|
|
80
|
+
pub use imp::{arm, arm_gate, Gate};
|
|
81
|
+
#[cfg(feature = "faults")]
|
|
82
|
+
pub(crate) use imp::{gate, hit};
|
|
83
|
+
|
|
84
|
+
#[cfg(not(feature = "faults"))]
|
|
85
|
+
#[inline(always)]
|
|
86
|
+
pub(crate) fn hit(_point: &'static str) -> crate::Result<()> {
|
|
87
|
+
Ok(())
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
#[cfg(not(feature = "faults"))]
|
|
91
|
+
#[inline(always)]
|
|
92
|
+
pub(crate) fn gate(_point: &'static str, _stream: crate::cuda::CUstream) -> crate::Result<()> {
|
|
93
|
+
Ok(())
|
|
94
|
+
}
|