S3TorchConnectorClient

1.5.0 · active · verified Wed Apr 15

The `s3torchconnectorclient` library is an internal S3 client implementation that underpins the `s3torchconnector` library. It provides high-throughput data access and checkpointing capabilities for PyTorch training jobs interacting with Amazon S3. It is currently at version 1.5.0 and is actively developed with regular releases, often in sync with the broader `s3torchconnector` project.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to directly configure the `S3ClientConfig` which is part of `s3torchconnectorclient`. While direct interaction with this low-level client is possible, it's more commonly used by passing `S3ClientConfig` instances to higher-level APIs provided by the `s3torchconnector` library for datasets and readers. This example sets a custom part size and throughput target. Ensure AWS credentials are configured (e.g., via environment variables or AWS CLI) for actual S3 operations.

import os
from s3torchconnectorclient import S3ClientConfig

# Configure the S3 client directly. This configuration is typically
# passed to higher-level constructors within the `s3torchconnector` library.
config = S3ClientConfig(
    part_size=10 * 1024 * 1024, # Example: 10 MiB part size for transfers
    throughput_target_gbps=5.0, # Example: Target 5 Gbps throughput
    profile=os.environ.get('AWS_PROFILE', None) # Use an AWS profile if specified
)

print(f"S3ClientConfig created with part size: {config.part_size / (1024*1024):.1f} MiB")
print(f"S3ClientConfig created with throughput target: {config.throughput_target_gbps} Gbps")
print(f"S3ClientConfig using AWS profile: {config.profile}")

# In a real application, 'config' would typically be used like this (requires 's3torchconnector'):
# from s3torchconnector import S3ReaderConstructor
# reader_constructor = S3ReaderConstructor.sequential(s3_client_config=config)
# dataset = S3MapDataset.from_prefix(DATASET_URI, region=REGION, reader_constructor=reader_constructor)

view raw JSON →