nemo_rl.utils.weight_transfer_stream#
Shared sparse payload pipeline and S3 transport for remote vLLM refit.
Module Contents#
Classes#
Transport-specific callbacks used by the shared streaming pipeline. |
|
Functions#
Data#
API#
- nemo_rl.utils.weight_transfer_stream._STREAM_LOCAL#
‘local(…)’
- nemo_rl.utils.weight_transfer_stream._S3_PART_SIZE#
None
- nemo_rl.utils.weight_transfer_stream._S3_MEMORY_LIMIT#
None
- class nemo_rl.utils.weight_transfer_stream.SparseRefitTransport#
Transport-specific callbacks used by the shared streaming pipeline.
- transfer_workers: int#
None
- send: Callable[[bytes, int, int], dict[str, Any]]#
None
- cleanup: Callable[[], None]#
None
- class nemo_rl.utils.weight_transfer_stream._SparsePayloadBucket#
- payloads: list[nemo_rl.utils.weight_transfer_sparse_codec.TensorPayload]#
None
- dense_bytes: int#
0
- encode_s: float#
0.0
- next_index: int#
0
- nemo_rl.utils.weight_transfer_stream._s3_client(region: str) Any#
- class nemo_rl.utils.weight_transfer_stream._S3ObjectStore(*, bucket: str, region: str)#
Initialization
- put(key: str, body: bytes) None#
- get(key: str) bytearray#
- delete(key: str) None#
- _request(
- method: str,
- key: str,
- body: bytes | None = None,
- nemo_rl.utils.weight_transfer_stream.sparse_payload_checksum(body: bytes | bytearray) str#
- nemo_rl.utils.weight_transfer_stream.decode_sparse_payload(body: bytes | bytearray, checksum: str) bytes#
- nemo_rl.utils.weight_transfer_stream.iter_sparse_weight_chunks(
- tensors: collections.abc.Iterable[nemo_rl.utils.weight_transfer_sparse_codec.NamedTensor],
- target_bytes: int,
- nemo_rl.utils.weight_transfer_stream._get_manifest_s3_store(
- bucket: str,
- region: str,
- nemo_rl.utils.weight_transfer_stream.sparse_export_chunk_size(
- delta_tracker: nemo_rl.utils.weight_transfer_sparse_codec.DeltaCompressionTracker,
- transport: nemo_rl.models.generation.vllm.config.VllmRefitTransportName,
- nemo_rl.utils.weight_transfer_stream._executor(
- key: str,
- workers: int,
- nemo_rl.utils.weight_transfer_stream.init_sparse_delta_baseline_from_iterator(
- iterator: collections.abc.Iterable[nemo_rl.utils.weight_transfer_sparse_codec.NamedTensor],
- *,
- delta_tracker: nemo_rl.utils.weight_transfer_sparse_codec.DeltaCompressionTracker,
- shard_rank: int,
- shard_count: int,
- transport: nemo_rl.models.generation.vllm.config.VllmRefitTransportName,
- nemo_rl.utils.weight_transfer_stream.stream_sparse_delta_payloads(
- iterator: collections.abc.Iterable[nemo_rl.utils.weight_transfer_sparse_codec.NamedTensor],
- *,
- delta_tracker: nemo_rl.utils.weight_transfer_sparse_codec.DeltaCompressionTracker,
- transport: nemo_rl.utils.weight_transfer_stream.SparseRefitTransport,
- shard_rank: int,
- shard_count: int,
- nemo_rl.utils.weight_transfer_stream.stream_sparse_delta_payloads_via_s3_manifest(
- iterator: collections.abc.Iterable[nemo_rl.utils.weight_transfer_sparse_codec.NamedTensor],
- *,
- delta_tracker: nemo_rl.utils.weight_transfer_sparse_codec.DeltaCompressionTracker,
- refit_targets: collections.abc.Sequence[str],
- transfer_id: str,
- api_key_env_var: str | None,
- timeout_s: float,
- shard_rank: int,
- shard_count: int,
- nemo_rl.utils.weight_transfer_stream.download_s3_refit_payload(
- manifest: collections.abc.Mapping[str, Any],
- nemo_rl.utils.weight_transfer_stream.zstd_compress(raw: bytes, threads: int) bytes#