Calculate S3 Multipart Part Size Before Uploading a Large Model Checkpoint

For one S3 object, divide its byte size by 10,000 and round up your proposed part size until the resulting upload fits within the maximum part count. Check that choice against S3’s part-size bounds. Run the calculation per object for a sharded checkpoint, because the count limit applies to each multipart upload.

Start with the largest object

List the objects your checkpoint writer actually produces. Eight 200 GiB files have a different upload shape from one 1,600 GiB file, even though both plans store the same total bytes. S3 allows up to 10,000 parts per multipart upload. In the current documented limits, parts are normally 5 MiB to 5 GiB, and the last part has no minimum. Keep MiB and GiB consistent when you make the division.

Test a candidate size with realistic boundaries

For a synthetic 800 GiB object, 800 × 1,024 gives 819,200 MiB. At 64 MiB per part that takes 12,800 parts. At 128 MiB per part it takes 6,400. The second choice fits the count limit, with room for a modest increase in object size. Larger parts can lower request traffic, but a failed part also represents a larger unit to transfer again. Client buffering and concurrency determine how much memory that configuration uses.

Validate recovery on a non-production object

Save the part size and concurrency reported by the client and compare them with your planned values. Use a test object to verify its completed length and the application’s selected integrity check. The client must wait for the completion response before treating the final object as available. Measure upload time as well as recovery time if the connection drops. The numeric example is a planning calculation and does not report a live transfer.

Sources

댓글

이 블로그의 인기 게시물

소니 A6000 Wi-Fi 전송 (컴퓨터로 보내기)

C#, cmd 명령어 창 안보이게 실행하기

SVN 서버 설치 및 웹 접속 설정-Ubuntu 14.04