forked from awslabs/s3-connector-for-pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename config class and move to s3torchconnector
- Loading branch information
dnnanuti
committed
Mar 21, 2024
1 parent
5ee1e6b
commit a093ad0
Showing
14 changed files
with
85 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# // SPDX-License-Identifier: BSD | ||
|
||
from .s3client_config import S3ClientConfig | ||
from ._s3client import S3Client | ||
from ._mock_s3client import MockS3Client | ||
|
||
__all__ = ["S3Client", "MockS3Client"] | ||
__all__ = [ | ||
"S3ClientConfig", | ||
"S3Client", | ||
"MockS3Client", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
s3torchconnector/src/s3torchconnector/_s3client/s3client_config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# // SPDX-License-Identifier: BSD | ||
from dataclasses import dataclass | ||
|
||
|
||
@dataclass(frozen=True) | ||
class S3ClientConfig: | ||
"""A dataclass exposing configurable parameters for the S3 client. | ||
Returns a config wrapper object. | ||
Args: | ||
throughput_target_gbps(float): Throughput target in Gigabits per second (Gbps) that we are trying to reach. | ||
You can also use get_recommended_throughput_target_gbps() to get recommended value for your system. | ||
10.0 Gbps by default (may change in future). | ||
part_size(int): Size, in bytes, of parts that files will be downloaded or uploaded in. | ||
Note: for saving checkpoints, the inner client will adjust the part size to meet the service limits. | ||
(max number of parts per upload is 10,000, minimum upload part size is 5 MiB). | ||
8MB by default (may change in future). | ||
""" | ||
|
||
throughput_target_gbps: float = 10.0 | ||
part_size: int = 8 * 1024 * 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.