Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+249
- bin/deepspeed.ptAdded+3
- bin/ninjaAdded+3
- lib/python3.12/site-packages/IPython/core/__pycache__/completer.cpython-312.pycAdded+3
- lib/python3.12/site-packages/IPython/core/__pycache__/interactiveshell.cpython-312.pycAdded+3
- lib/python3.12/site-packages/_yaml/__init__.pyAdded+33
- lib/python3.12/site-packages/_yaml/__pycache__/__init__.cpython-312.pycAdded
- lib/python3.12/site-packages/absl/testing/__pycache__/absltest.cpython-312.pycAdded+3
- lib/python3.12/site-packages/attr/__pycache__/_make.cpython-312.pycAdded+3
- lib/python3.12/site-packages/certifi-2026.1.4.dist-info/INSTALLERAdded+1
- lib/python3.12/site-packages/certifi-2026.1.4.dist-info/METADATAAdded+78
- lib/python3.12/site-packages/certifi-2026.1.4.dist-info/RECORDAdded+14
- lib/python3.12/site-packages/certifi-2026.1.4.dist-info/WHEELAdded+5
- lib/python3.12/site-packages/certifi-2026.1.4.dist-info/licenses/LICENSEAdded+20
- lib/python3.12/site-packages/certifi-2026.1.4.dist-info/top_level.txtAdded+1
- lib/python3.12/site-packages/cusparselt/lib/libcusparseLt.so.0Added+3
- lib/python3.12/site-packages/datasets/__pycache__/arrow_dataset.cpython-312.pycAdded+3
- lib/python3.12/site-packages/datasets/__pycache__/dataset_dict.cpython-312.pycAdded+3
- lib/python3.12/site-packages/datasets/__pycache__/iterable_dataset.cpython-312.pycAdded+3
- lib/python3.12/site-packages/datasets/__pycache__/table.cpython-312.pycAdded+3
- lib/python3.12/site-packages/datasets/features/__pycache__/features.cpython-312.pycAdded+3
- lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/INSTALLERAdded+1
- lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/METADATAAdded+443
- lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/RECORDAdded
- lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/REQUESTEDAdded
- lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/WHEELAdded+5
- lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/entry_points.txtAdded+2
- lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/licenses/LICENSEAdded+201
- lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/top_level.txtAdded+1
- lib/python3.12/site-packages/deepspeed/nebula/__pycache__/__init__.cpython-312.pycAdded
- lib/python3.12/site-packages/distutils-precedence.pthAdded+3
- lib/python3.12/site-packages/filelock/__init__.pyAdded+70
- lib/python3.12/site-packages/filelock/__pycache__/__init__.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/__pycache__/_api.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/__pycache__/_error.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/__pycache__/_soft.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/__pycache__/_unix.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/__pycache__/_util.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/__pycache__/_windows.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/__pycache__/asyncio.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/__pycache__/version.cpython-312.pycAdded
- lib/python3.12/site-packages/filelock/_api.pyAdded+403
- lib/python3.12/site-packages/filelock/_error.pyAdded+30
- lib/python3.12/site-packages/filelock/_soft.pyAdded+47
- lib/python3.12/site-packages/filelock/_unix.pyAdded+70
- lib/python3.12/site-packages/filelock/_util.pyAdded+52
- lib/python3.12/site-packages/filelock/_windows.pyAdded+65
- lib/python3.12/site-packages/filelock/asyncio.pyAdded+342
- lib/python3.12/site-packages/filelock/py.typedAdded
- lib/python3.12/site-packages/filelock/version.pyAdded+21
271 unmodified lines272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523271 unmodified lineslib/python3.12/site-packages/transformers/models/deprecated/deta/__pycache__/modeling_deta.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/transformers/models/deprecated/mega/__pycache__/modeling_mega.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/transformers/models/speecht5/__pycache__/modeling_speecht5.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textbin/ninja filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/flash_attn_2_cuda.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/_path.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/_image.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/_tri.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/ft2font.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/_c_internal_utils.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/_qhull.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/tests/__pycache__/test_figure.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/tests/__pycache__/test_axes.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/tests/__pycache__/test_ticker.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/tests/__pycache__/test_image.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/axes/__pycache__/_base.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/axes/__pycache__/_axes.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/backends/_tkagg.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/backends/_backend_agg.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/backend_bases.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/_mathtext.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/pyplot.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/patches.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/figure.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/ticker.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/colors.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/transforms.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/widgets.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/collections.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/_cm_listed.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/__pycache__/axis.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/backends/__pycache__/backend_pdf.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansMono-BoldOblique.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneral.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralBolIta.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans-BoldOblique.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSerif-Italic.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansMono.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSerif-Bold.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans-Bold.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSerif.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansMono-Bold.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSerif-BoldItalic.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansMono-Oblique.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralItalic.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans-Oblique.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/matplotlib/mpl-data/fonts/ttf/STIXGeneralBol.ttf filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/zmq/backend/cython/_zmq.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/orjson/orjson.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/safetensors/_safetensors_rust.abi3.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/cusparselt/lib/libcusparseLt.so.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libharfbuzz-0692f733.so.0.61230.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libtiff-295fd75c.so.6.2.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libzstd-761a17b6.so.1.5.7 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libjpeg-18a3f47f.so.62.4.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libwebp-d8b9687f.so.7.2.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/liblcms2-cc10e42f.so.2.0.17 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libpng16-4a38ea05.so.16.53.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libfreetype-ee1c40c4.so.6.20.4 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/liblzma-61b1002e.so.5.8.2 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libopenjp2-94e588ba.so.2.5.4 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libxcb-64009ff3.so.1.1.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libbrotlicommon-c55a5f7a.so.1.2.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pillow.libs/libavif-01e67780.so.16.3.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cusolver/lib/libcusolverMg.so.11 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cusolver/lib/libcusolver.so.11 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn.so.9 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn_cnn.so.9 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn_ops.so.9 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn_engines_runtime_compiled.so.9 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn_heuristic.so.9 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn_graph.so.9 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cuda_nvrtc/lib/libnvrtc-builtins.so.12.4 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn_adv.so.9 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cuda_nvrtc/lib/libnvrtc.so.12 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cufft/lib/libcufftw.so.11 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cuda_runtime/lib/libcudart.so.12 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cusparse/lib/libcusparse.so.12 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cuda_cupti/lib/libnvperf_target.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cuda_cupti/lib/libcupti.so.12 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cuda_cupti/lib/libnvperf_host.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cuda_cupti/lib/libcheckpoint.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cuda_cupti/lib/libpcsamplingutil.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/nccl/lib/libnccl.so.2 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/curand/lib/libcurand.so.10 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn_engines_precompiled.so.9 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/nvjitlink/lib/libnvJitLink.so.12 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cufft/lib/libcufft.so.11 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cublas/lib/libcublas.so.12 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cublas/lib/libnvblas.so.12 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/nvidia/cublas/lib/libcublasLt.so.12 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/physics/continuum_mechanics/__pycache__/beam.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/physics/control/__pycache__/lti.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/physics/control/tests/__pycache__/test_lti.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/physics/mechanics/tests/__pycache__/test_joint.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/physics/quantum/__pycache__/spin.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/stats/tests/__pycache__/test_continuous_rv.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/stats/__pycache__/stochastic_process_types.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/stats/__pycache__/crv_types.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/physics/__pycache__/secondquant.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/physics/biomechanics/tests/__pycache__/test_curve.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/physics/quantum/tests/__pycache__/test_spin.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/tests/__pycache__/test_numbers.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/tests/__pycache__/test_args.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/tests/__pycache__/test_relational.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/tests/__pycache__/test_arit.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/tests/__pycache__/test_expr.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/__pycache__/expr.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/__pycache__/function.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/__pycache__/numbers.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/core/tests/__pycache__/test_function.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/tests/__pycache__/test_solveset.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/tests/__pycache__/test_solvers.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/diophantine/__pycache__/diophantine.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/ode/tests/__pycache__/test_ode.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/ode/tests/__pycache__/test_single.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/ode/tests/__pycache__/test_systems.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/ode/__pycache__/single.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/ode/__pycache__/ode.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/__pycache__/solveset.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/solvers/__pycache__/solvers.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/crypto/__pycache__/crypto.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/integrals/tests/__pycache__/test_integrals.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/integrals/__pycache__/manualintegrate.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/integrals/__pycache__/meijerint.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/integrals/__pycache__/laplace.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/tests/__pycache__/test_rings.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/tests/__pycache__/test_polytools.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/numberfields/__pycache__/resolvent_lookup.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/domains/tests/__pycache__/test_domains.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/matrices/tests/__pycache__/test_domainmatrix.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/matrices/__pycache__/domainmatrix.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/benchmarks/__pycache__/bench_solvers.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/__pycache__/rings.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/__pycache__/compatibility.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/__pycache__/polytools.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/__pycache__/polyquinticconst.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/polys/__pycache__/polyclasses.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/matrices/tests/__pycache__/test_matrices.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/matrices/tests/__pycache__/test_matrixbase.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/matrices/__pycache__/common.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/matrices/__pycache__/matrixbase.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/geometry/__pycache__/polygon.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/holonomic/__pycache__/holonomic.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/concrete/tests/__pycache__/test_sums_products.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/functions/elementary/tests/__pycache__/test_trigonometric.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/functions/elementary/tests/__pycache__/test_piecewise.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/functions/elementary/tests/__pycache__/test_hyperbolic.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/functions/elementary/__pycache__/hyperbolic.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/functions/elementary/__pycache__/trigonometric.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/functions/special/__pycache__/error_functions.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/functions/combinatorial/tests/__pycache__/test_comb_numbers.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/functions/combinatorial/__pycache__/numbers.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/series/tests/__pycache__/test_limits.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/combinatorics/__pycache__/permutations.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/combinatorics/__pycache__/perm_groups.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/utilities/tests/__pycache__/test_lambdify.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/utilities/tests/__pycache__/test_wester.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/utilities/__pycache__/iterables.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/plotting/tests/__pycache__/test_series.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/plotting/__pycache__/series.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/printing/tests/__pycache__/test_mathml.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/printing/tests/__pycache__/test_latex.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/printing/pretty/tests/__pycache__/test_pretty.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/printing/pretty/__pycache__/pretty.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/printing/__pycache__/mathml.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/printing/__pycache__/latex.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/simplify/__pycache__/hyperexpand.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevparser.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/parsing/autolev/__pycache__/_listener_autolev_antlr.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/parsing/tests/__pycache__/test_c_parser.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/assumptions/tests/__pycache__/test_query.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/parsing/latex/_antlr/__pycache__/latexparser.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/sets/tests/__pycache__/test_fancysets.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/sets/tests/__pycache__/test_sets.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/sets/__pycache__/sets.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/tensor/tests/__pycache__/test_tensor.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/tensor/array/expressions/__pycache__/array_expressions.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/tensor/__pycache__/tensor.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/logic/tests/__pycache__/test_boolalg.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/sympy/logic/__pycache__/boolalg.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pygments/lexers/__pycache__/lisp.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/rich/__pycache__/console.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/__pycache__/typing_extensions.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/IPython/core/__pycache__/completer.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/IPython/core/__pycache__/interactiveshell.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/jiter/jiter.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pydantic_core/__pycache__/core_schema.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pydantic_core/_pydantic_core.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torchaudio/transforms/__pycache__/_transforms.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torchaudio/functional/__pycache__/functional.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torchaudio/lib/_torchaudio_sox.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torchaudio/lib/pybind11_prefixctc.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torchaudio/lib/_torchaudio.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torchaudio/lib/libctc_prefix_decoder.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torchaudio/lib/libtorchaudio_sox.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torchaudio/lib/libtorchaudio.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/kiwisolver/_cext.cpython-312-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/absl/testing/__pycache__/absltest.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/datasets/__pycache__/dataset_dict.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/datasets/__pycache__/table.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/datasets/__pycache__/iterable_dataset.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/datasets/__pycache__/arrow_dataset.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/datasets/features/__pycache__/features.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torio/lib/libtorio_ffmpeg5.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torio/lib/libtorio_ffmpeg6.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torio/lib/_torio_ffmpeg5.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torio/lib/_torio_ffmpeg6.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torio/lib/libtorio_ffmpeg4.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torio/lib/_torio_ffmpeg4.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pyzmq.libs/libzmq-56587b1b.so.5.2.5 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/pyzmq.libs/libsodium-14725a37.so.26.2.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/attr/__pycache__/_make.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/bin/protoc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/bin/protoc-3.13.0.0 filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/onnx/__pycache__/symbolic_opset9.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/nn/parallel/__pycache__/distributed.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/nn/modules/__pycache__/loss.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/nn/modules/__pycache__/module.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/nn/__pycache__/functional.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/_dynamo/variables/__pycache__/higher_order_ops.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/_dynamo/variables/__pycache__/builder.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/_dynamo/__pycache__/trace_rules.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/_dynamo/__pycache__/symbolic_convert.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/_dynamo/__pycache__/guards.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/_dynamo/__pycache__/output_graph.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/_dynamo/__pycache__/utils.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/utils/hipify/__pycache__/cuda_to_hip_mappings.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/utils/__pycache__/cpp_extension.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/backends/_nnapi/__pycache__/serializer.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/nested/_internal/__pycache__/ops.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/generated/__pycache__/annotated_fn_args.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/opinfo/__pycache__/core.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/__pycache__/common_methods_invocations.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/__pycache__/common_utils.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/__pycache__/common_modules.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/__pycache__/common_nn.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/__pycache__/common_quantization.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/distributed/rpc/__pycache__/dist_autograd_test.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/distributed/rpc/__pycache__/rpc_test.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/testing/_internal/distributed/__pycache__/distributed_test.cpython-312.pyc filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/lib/libc10_cuda.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/lib/libtorch.so filter=lfs diff=lfs merge=lfs -textlib/python3.12/site-packages/torch/lib/libtorch_python.so filter=lfs diff=lfs merge=lfs -text123version https://git-lfs.github.com/spec/v1oid sha256:4ae1bb31b9f6a65d503678a9a1c179866b0791be0c5d7a290050069a4438e33bsize 138123version https://git-lfs.github.com/spec/v1oid sha256:696f9628a79d9ce50314cf9556d7cd1a1d1ec52b8fd52828f6f9db1719565b67size 372384123version https://git-lfs.github.com/spec/v1oid sha256:19f383c640f7f8b1670f082f0dcfceba6891039e584d7ba0ce95cfab2e151a48size 138384123version https://git-lfs.github.com/spec/v1oid sha256:94a525c3c84ae8f0a5daecf03f89fa46117f6a171709e883f2fd17e93cea2114size 156014123456789101112131415161718192021222324252627282930313233# This is a stub package designed to roughly emulate the _yaml# extension module, which previously existed as a standalone module# and has been moved into the `yaml` package namespace.# It does not perfectly mimic its old counterpart, but should get# close enough for anyone who's relying on it even when they shouldn't.import yaml
# in some circumstances, the yaml module we imoprted may be from a different version, so we need# to tread carefully when poking at it here (it may not have the attributes we expect)if not getattr(yaml, '__with_libyaml__', False): from sys import version_info
exc = ModuleNotFoundError if version_info >= (3, 6) else ImportError raise exc("No module named '_yaml'")else: from yaml._yaml import * import warnings warnings.warn( 'The _yaml extension module is now located at yaml._yaml' ' and its location is subject to change. To use the' ' LibYAML-based parser and emitter, import from `yaml`:' ' `from yaml import CLoader as Loader, CDumper as Dumper`.', DeprecationWarning ) del warnings # Don't `del yaml` here because yaml is actually an existing # namespace member of _yaml.
__name__ = '_yaml'# If the module is top-level (i.e. not a part of any specific package)# then the attribute should be set to ''.# https://docs.python.org/3.8/library/types.html__package__ = ''123version https://git-lfs.github.com/spec/v1oid sha256:8e62272a062e8e49a48ff9f414540b680215c670f90f3bb519fc6fc2385bf3e9size 120999123version https://git-lfs.github.com/spec/v1oid sha256:222ebcb0a8ff4922dac40b4232b4eeaedbc100324d6c128b7d65587a116fc525size 1070251pip123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778Metadata-Version: 2.4Name: certifiVersion: 2026.1.4Summary: Python package for providing Mozilla's CA Bundle.Home-page: https://github.com/certifi/python-certifiAuthor: Kenneth ReitzAuthor-email: me@kennethreitz.comLicense: MPL-2.0Project-URL: Source, https://github.com/certifi/python-certifiClassifier: Development Status :: 5 - Production/StableClassifier: Intended Audience :: DevelopersClassifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Classifier: Natural Language :: EnglishClassifier: Programming Language :: PythonClassifier: Programming Language :: Python :: 3Classifier: Programming Language :: Python :: 3 :: OnlyClassifier: Programming Language :: Python :: 3.7Classifier: Programming Language :: Python :: 3.8Classifier: Programming Language :: Python :: 3.9Classifier: Programming Language :: Python :: 3.10Classifier: Programming Language :: Python :: 3.11Classifier: Programming Language :: Python :: 3.12Classifier: Programming Language :: Python :: 3.13Classifier: Programming Language :: Python :: 3.14Requires-Python: >=3.7License-File: LICENSEDynamic: authorDynamic: author-emailDynamic: classifierDynamic: descriptionDynamic: home-pageDynamic: licenseDynamic: license-fileDynamic: project-urlDynamic: requires-pythonDynamic: summary
Certifi: Python SSL Certificates================================
Certifi provides Mozilla's carefully curated collection of Root Certificates forvalidating the trustworthiness of SSL certificates while verifying the identityof TLS hosts. It has been extracted from the `Requests`_ project.
Installation------------
``certifi`` is available on PyPI. Simply install it with ``pip``::
$ pip install certifi
Usage-----
To reference the installed certificate authority (CA) bundle, you can use thebuilt-in function::
>>> import certifi
>>> certifi.where() '/usr/local/lib/python3.7/site-packages/certifi/cacert.pem'
Or from the command line::
$ python -m certifi /usr/local/lib/python3.7/site-packages/certifi/cacert.pem
Enjoy!
.. _`Requests`: https://requests.readthedocs.io/en/master/
Addition/Removal of Certificates--------------------------------
Certifi does not support any addition/removal or other modification of theCA trust store content. This project is intended to provide a reliable andhighly portable root of trust to python deployments. Look to upstream projectsfor methods to use alternate trust.1234567891011121314certifi-2026.1.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
certifi-2026.1.4.dist-info/METADATA,sha256=FSfJEfKuMo6bJlofUrtRpn4PFTYtbYyXpHN_A3ZFpIY,2473
certifi-2026.1.4.dist-info/RECORD,,
certifi-2026.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
certifi-2026.1.4.dist-info/licenses/LICENSE,sha256=6TcW2mucDVpKHfYP5pWzcPBpVgPSH2-D8FPkLPwQyvc,989
certifi-2026.1.4.dist-info/top_level.txt,sha256=KMu4vUCfsjLrkPbSNdgdekS-pVJzBAJFO__nI8NF6-U,8
certifi/__init__.py,sha256=969deMMS7Uchipr0oO4dbRBUvRi0uNYCn07VmG1aTrg,94
certifi/__main__.py,sha256=xBBoj905TUWBLRGANOcf7oi6e-3dMP4cEoG9OyMs11g,243
certifi/__pycache__/__init__.cpython-312.pyc,,
certifi/__pycache__/__main__.cpython-312.pyc,,
certifi/__pycache__/core.cpython-312.pyc,,
certifi/cacert.pem,sha256=Tzl1_zCrvzVEO0hgZK6Ly0Hf9wf_31dsdtKS-0WKoKk,270954
certifi/core.py,sha256=XFXycndG5pf37ayeF8N32HUuDafsyhkVMbO4BAPWHa0,3394
certifi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,012345Wheel-Version: 1.0Generator: setuptools (80.9.0)Root-Is-Purelib: trueTag: py3-none-any
1234567891011121314151617181920This package contains a modified version of ca-bundle.crt:
ca-bundle.crt -- Bundle of CA Root Certificates
This is a bundle of X.509 certificates of public Certificate Authorities(CA). These were automatically extracted from Mozilla's root certificatesfile (certdata.txt). This file can be found in the mozilla source tree:https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txtIt contains the certificates in PEM format and thereforecan be directly used with curl / libcurl / php_curl, or withan Apache+mod_ssl webserver for SSL client authentication.Just configure this file as the SSLCACertificateFile.#
***** BEGIN LICENSE BLOCK *****This Source Code Form is subject to the terms of the Mozilla Public License,v. 2.0. If a copy of the MPL was not distributed with this file, You can obtainone at http://mozilla.org/MPL/2.0/.
***** END LICENSE BLOCK *****@(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $1certifi123version https://git-lfs.github.com/spec/v1oid sha256:42385f413fe87ce1c844b13890f920b66873dbd36030a3b0fd2c143d722f6879size 212602113123version https://git-lfs.github.com/spec/v1oid sha256:1ca190052b1674e451855d25a25f8bddddd8e1df83bce4d8614d1553d3e93163size 304251123version https://git-lfs.github.com/spec/v1oid sha256:b62906f4e998cc35e21fad755ad9ddc2ab87ae20d9eed99e1fd37532aa9fd7dasize 115763123version https://git-lfs.github.com/spec/v1oid sha256:c9de0375d04e581c293cd6526acf23f5f819e858666469673bb730e85aad3f1dsize 191305123version https://git-lfs.github.com/spec/v1oid sha256:ed415b689c46a2b0257b790eb01222f0d5fd62908785f35f79a858403ab11ba9size 112721123version https://git-lfs.github.com/spec/v1oid sha256:6a07dc4cbba2b5725cfac1aaff539a6bb8386929cb1ee8bc10a84d359149d3fasize 1164431pip123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443Metadata-Version: 2.4Name: deepspeedVersion: 0.17.0Summary: DeepSpeed libraryHome-page: http://deepspeed.aiAuthor: DeepSpeed TeamAuthor-email: deepspeed-info@microsoft.comLicense: Apache Software License 2.0Project-URL: Documentation, https://deepspeed.readthedocs.ioProject-URL: Source, https://github.com/deepspeedai/DeepSpeedClassifier: Programming Language :: Python :: 3.8Classifier: Programming Language :: Python :: 3.9Classifier: Programming Language :: Python :: 3.10Classifier: Programming Language :: Python :: 3.11Classifier: Programming Language :: Python :: 3.12Description-Content-Type: text/markdownLicense-File: LICENSERequires-Dist: einopsRequires-Dist: hjsonRequires-Dist: msgpackRequires-Dist: ninjaRequires-Dist: numpyRequires-Dist: packaging>=20.0Requires-Dist: psutilRequires-Dist: py-cpuinfoRequires-Dist: pydantic>=2.0.0Requires-Dist: torchRequires-Dist: tqdmProvides-Extra: 1bitProvides-Extra: 1bit-mpiRequires-Dist: mpi4py; extra == "1bit-mpi"Provides-Extra: readthedocsRequires-Dist: autodoc_pydantic>=2.0.0; extra == "readthedocs"Requires-Dist: docutils<0.18; extra == "readthedocs"Requires-Dist: hjson; extra == "readthedocs"Requires-Dist: packaging; extra == "readthedocs"Requires-Dist: psutil; extra == "readthedocs"Requires-Dist: py-cpuinfo; extra == "readthedocs"Requires-Dist: pydantic>=2.0.0; extra == "readthedocs"Requires-Dist: recommonmark; extra == "readthedocs"Requires-Dist: sphinx_rtd_theme; extra == "readthedocs"Requires-Dist: torch; extra == "readthedocs"Requires-Dist: tqdm; extra == "readthedocs"Provides-Extra: devRequires-Dist: accelerate; extra == "dev"Requires-Dist: clang-format==18.1.3; extra == "dev"Requires-Dist: comet_ml>=3.41.0; extra == "dev"Requires-Dist: deepspeed-kernels; sys_platform == "linux" and extra == "dev"Requires-Dist: docutils<0.18; extra == "dev"Requires-Dist: future; extra == "dev"Requires-Dist: importlib-metadata>=4; extra == "dev"Requires-Dist: mup; extra == "dev"Requires-Dist: pre-commit>=3.2.0; extra == "dev"Requires-Dist: pytest>=7.2.0; extra == "dev"Requires-Dist: pytest-forked; extra == "dev"Requires-Dist: pytest-randomly; extra == "dev"Requires-Dist: pytest-xdist; extra == "dev"Requires-Dist: qtorch==0.3.0; extra == "dev"Requires-Dist: recommonmark; extra == "dev"Requires-Dist: sphinx; extra == "dev"Requires-Dist: sphinx-rtd-theme; extra == "dev"Requires-Dist: tensorboard; extra == "dev"Requires-Dist: torchvision; extra == "dev"Requires-Dist: transformers>=4.51.3; extra == "dev"Requires-Dist: wandb; extra == "dev"Provides-Extra: autotuningRequires-Dist: tabulate; extra == "autotuning"Provides-Extra: autotuning-mlRequires-Dist: hjson; extra == "autotuning-ml"Requires-Dist: tabulate; extra == "autotuning-ml"Requires-Dist: xgboost; extra == "autotuning-ml"Provides-Extra: sparse-attnRequires-Dist: triton==1.0.0; extra == "sparse-attn"Provides-Extra: sparseRequires-Dist: neural-compressor==2.1.0; extra == "sparse"Provides-Extra: infRequires-Dist: google; extra == "inf"Requires-Dist: lm-eval==0.3.0; extra == "inf"Requires-Dist: protobuf; extra == "inf"Requires-Dist: qtorch; extra == "inf"Requires-Dist: safetensors; extra == "inf"Requires-Dist: sentencepiece; extra == "inf"Requires-Dist: transformers>=4.32.1; extra == "inf"Provides-Extra: sdRequires-Dist: diffusers>=0.25.0; extra == "sd"Requires-Dist: triton>=2.1.0; extra == "sd"Provides-Extra: tritonRequires-Dist: triton==2.1.0; extra == "triton"Provides-Extra: deepcompileRequires-Dist: scipy; extra == "deepcompile"Provides-Extra: allRequires-Dist: mpi4py; extra == "all"Requires-Dist: deepspeed-kernels; sys_platform == "linux" and extra == "all"Requires-Dist: torch; extra == "all"Requires-Dist: transformers>=4.51.3; extra == "all"Requires-Dist: tensorboard; extra == "all"Requires-Dist: pytest>=7.2.0; extra == "all"Requires-Dist: protobuf; extra == "all"Requires-Dist: packaging; extra == "all"Requires-Dist: google; extra == "all"Requires-Dist: qtorch; extra == "all"Requires-Dist: triton==1.0.0; extra == "all"Requires-Dist: xgboost; extra == "all"Requires-Dist: future; extra == "all"Requires-Dist: docutils<0.18; extra == "all"Requires-Dist: scipy; extra == "all"Requires-Dist: recommonmark; extra == "all"Requires-Dist: tqdm; extra == "all"Requires-Dist: qtorch==0.3.0; extra == "all"Requires-Dist: diffusers>=0.25.0; extra == "all"Requires-Dist: triton>=2.1.0; extra == "all"Requires-Dist: triton==2.1.0; extra == "all"Requires-Dist: autodoc_pydantic>=2.0.0; extra == "all"Requires-Dist: wandb; extra == "all"Requires-Dist: clang-format==18.1.3; extra == "all"Requires-Dist: sentencepiece; extra == "all"Requires-Dist: lm-eval==0.3.0; extra == "all"Requires-Dist: comet_ml>=3.41.0; extra == "all"Requires-Dist: pre-commit>=3.2.0; extra == "all"Requires-Dist: safetensors; extra == "all"Requires-Dist: transformers>=4.32.1; extra == "all"Requires-Dist: pydantic>=2.0.0; extra == "all"Requires-Dist: pytest-forked; extra == "all"Requires-Dist: pytest-randomly; extra == "all"Requires-Dist: sphinx; extra == "all"Requires-Dist: pytest-xdist; extra == "all"Requires-Dist: sphinx_rtd_theme; extra == "all"Requires-Dist: importlib-metadata>=4; extra == "all"Requires-Dist: hjson; extra == "all"Requires-Dist: sphinx-rtd-theme; extra == "all"Requires-Dist: py-cpuinfo; extra == "all"Requires-Dist: accelerate; extra == "all"Requires-Dist: tabulate; extra == "all"Requires-Dist: mup; extra == "all"Requires-Dist: neural-compressor==2.1.0; extra == "all"Requires-Dist: torchvision; extra == "all"Requires-Dist: psutil; extra == "all"Dynamic: authorDynamic: author-emailDynamic: classifierDynamic: descriptionDynamic: description-content-typeDynamic: home-pageDynamic: licenseDynamic: license-fileDynamic: project-urlDynamic: provides-extraDynamic: requires-distDynamic: summary
[](https://github.com/deepspeedai/DeepSpeed/blob/master/LICENSE)[](https://pypi.org/project/deepspeed/)[](https://pepy.tech/project/deepspeed)[](#build-pipeline-status)[](https://www.bestpractices.dev/projects/9530)[](https://twitter.com/intent/follow?screen_name=DeepSpeedAI)[](https://twitter.com/DeepSpeedAI_JP)[](https://www.zhihu.com/people/deepspeed)
<div align="center"> <img src="docs/assets/images/DeepSpeed_light.svg#gh-light-mode-only" width="400px"> <img src="docs/assets/images/DeepSpeed_dark_transparent.svg#gh-dark-mode-only" width="400px"></div>
## Latest News<b> <span style="color:orange" > DeepSpeed empowers ChatGPT-like model training with a single click, offering 15x speedup over SOTA RLHF systems with unprecedented cost reduction at all scales; [learn how](https://github.com/deepspeedai/DeepSpeed/tree/master/blogs/deepspeed-chat)</span>.</b>* [2025/04] [DeepCompile: Unlocking Compiler Optimization for Distributed Training](https://github.com/deepspeedai/DeepSpeed/blob/master/blogs/deepcompile/README.md)* [2025/03] [DeepSpeed-AutoTP: Automatic Tensor Parallel Training of Hugging Face models](https://github.com/deepspeedai/DeepSpeed/blob/master/blogs/huggingface-tp/README.md)* [2024/12] [Ulysses-Offload: Democratizing Long Context LLM Training ](https://github.com/deepspeedai/DeepSpeed/blob/master/blogs/ulysses-offload/README.md)* [2024/12] [DeepSpeed-Domino: Communication-Free LLM Training Engine](https://github.com/deepspeedai/DeepSpeed/blob/master/blogs/deepspeed-domino/README.md)* [2024/08] [DeepSpeed on Windows](https://github.com/deepspeedai/DeepSpeed/tree/master/blogs/windows/08-2024/README.md) [[日本語](https://github.com/deepspeedai/DeepSpeed/tree/master/blogs/windows/08-2024/japanese/README.md)] [[中文](https://github.com/deepspeedai/DeepSpeed/tree/master/blogs/windows/08-2024/chinese/README.md)]
<!-- NOTE: we must use html for news items otherwise links will be broken in the 'more news' section --><details> <summary>More news</summary> <ul> <li> [2024/08] <a href="https://github.com/deepspeedai/DeepSpeed/blob/master/blogs/deepspeed-gds/README.md"> DeepNVMe: Improving DL Applications through I/O Optimizations</a> [<a href="ttps://github.com/deepspeedai/DeepSpeed/blob/master/blogs/deepspeed-gds/japanese/README.md"> 日本語 </a>] [<a href="https://github.com/deepspeedai/DeepSpeed/blob/master/blogs/deepspeed-gds/japanese/README.md"> 中文 </a>]</li>
<li> [2024/07] <a href="https://github.com/microsoft/DeepSpeed/tree/master/blogs/deepspeed-ucp/README.md"> DeepSpeed Universal Checkpointing: Efficient and Flexible Checkpointing for Large Scale Distributed Training</a> [<a href="https://github.com/microsoft/DeepSpeed/tree/master/blogs/deepspeed-ucp/japanese/README.md"> 日本語 </a>] </li>
<li> [2024/03] <a href="https://github.com/microsoft/DeepSpeed/tree/master/blogs/deepspeed-fp6/03-05-2024/README.md"> DeepSpeed-FP6: The Power of FP6-Centric Serving for Large Language Models</a> [<a href="https://github.com/microsoft/DeepSpeed/tree/master/blogs/deepspeed-fp6/03-05-2024/README-Chinese.md"> 中文 </a>] </li>
</ul></details>
---
# Extreme Speed and Scale for DL Training and Inference
***[DeepSpeed](https://www.deepspeed.ai/) enabled the world's most powerful language models (at the time of this writing) such as [MT-530B](https://www.microsoft.com/en-us/research/blog/using-deepspeed-and-megatron-to-train-megatron-turing-nlg-530b-the-worlds-largest-and-most-powerful-generative-language-model/) and [BLOOM](https://huggingface.co/blog/bloom-megatron-deepspeed)***. It is an easy-to-use deep learning optimization software suite that powers unprecedented scale and speed for both training and inference. With DeepSpeed you can:
* Train/Inference dense or sparse models with billions or trillions of parameters* Achieve excellent system throughput and efficiently scale to thousands of GPUs* Train/Inference on resource constrained GPU systems* Achieve unprecedented low latency and high throughput for inference* Achieve extreme compression for an unparalleled inference latency and model size reduction with low costs
---
# DeepSpeed's four innovation pillars
<img src="docs/assets/images/DeepSpeed-pillars.png" width="800px">
## DeepSpeed-Training
DeepSpeed offers a confluence of system innovations, that has made large scale DL training effective, and efficient, greatly improved ease of use, and redefined the DL training landscape in terms of scale that is possible. These innovations such as ZeRO, 3D-Parallelism, DeepSpeed-MoE, ZeRO-Infinity, etc. fall under the training pillar. Learn more: [DeepSpeed-Training](https://www.deepspeed.ai/training/)
## DeepSpeed-Inference
DeepSpeed brings together innovations in parallelism technology such as tensor, pipeline, expert and ZeRO-parallelism, and combines them with high performance custom inference kernels, communication optimizations and heterogeneous memory technologies to enable inference at an unprecedented scale, while achieving unparalleled latency, throughput and cost reduction. This systematic composition of system technologies for inference falls under the inference pillar. Learn more: [DeepSpeed-Inference](https://www.deepspeed.ai/inference)
## DeepSpeed-Compression
To further increase the inference efficiency, DeepSpeed offers easy-to-use and flexible-to-compose compression techniques for researchers and practitioners to compress their models while delivering faster speed, smaller model size, and significantly reduced compression cost. Moreover, SoTA innovations on compression like ZeroQuant and XTC are included under the compression pillar. Learn more: [DeepSpeed-Compression](https://www.deepspeed.ai/compression)
## DeepSpeed4Science
In line with Microsoft's mission to solve humanity's most pressing challenges, the DeepSpeed team at Microsoft is responding to this opportunity by launching a new initiative called *DeepSpeed4Science*, aiming to build unique capabilities through AI system technology innovations to help domain experts to unlock today's biggest science mysteries. Learn more: [tutorials](https://www.deepspeed.ai/deepspeed4science/)
---
# DeepSpeed Software Suite
## DeepSpeed Library
The [DeepSpeed](https://github.com/deepspeedai/deepspeed) library (this repository) implements and packages the innovations and technologies in DeepSpeed Training, Inference and Compression Pillars into a single easy-to-use, open-sourced repository. It allows for easy composition of multitude of features within a single training, inference or compression pipeline. The DeepSpeed Library is heavily adopted by the DL community, and has been used to enable some of the most powerful models (see [DeepSpeed Adoption](#deepspeed-adoption)).
## Model Implementations for Inference (MII)
[Model Implementations for Inference (MII)](https://github.com/deepspeedai/deepspeed-mii) is an open-sourced repository for making low-latency and high-throughput inference accessible to all data scientists by alleviating the need to apply complex system optimization techniques themselves. Out-of-box, MII offers support for thousands of widely used DL models, optimized using DeepSpeed-Inference, that can be deployed with a few lines of code, while achieving significant latency reduction compared to their vanilla open-sourced versions.
## DeepSpeed on Azure
DeepSpeed users are diverse and have access to different environments. We recommend to try DeepSpeed on Azure as it is the simplest and easiest method. The recommended method to try DeepSpeed on Azure is through AzureML [recipes](https://github.com/Azure/azureml-examples/tree/main/v1/python-sdk/workflows/train/deepspeed). The job submission and data preparation scripts have been made available [here](https://github.com/deepspeedai/Megatron-DeepSpeed/tree/main/examples_deepspeed/azureml). For more details on how to use DeepSpeed on Azure, please follow the [Azure tutorial](https://www.deepspeed.ai/tutorials/azure/).
---
# DeepSpeed Adoption
DeepSpeed was an important part of Microsoft’s[AI at Scale](https://www.microsoft.com/en-us/research/project/ai-at-scale/)initiative to enable next-generation AI capabilities at scale, where you can find moreinformation [here](https://innovation.microsoft.com/en-us/exploring-ai-at-scale).
DeepSpeed has been used to train many different large-scale models, below is a list of several examples that we are aware of (if you'd like to include your model please submit a PR):
* [Megatron-Turing NLG (530B)](https://www.microsoft.com/en-us/research/blog/using-deepspeed-and-megatron-to-train-megatron-turing-nlg-530b-the-worlds-largest-and-most-powerful-generative-language-model/) * [Jurassic-1 (178B)](https://uploads-ssl.webflow.com/60fd4503684b466578c0d307/61138924626a6981ee09caf6_jurassic_tech_paper.pdf) * [BLOOM (176B)](https://huggingface.co/blog/bloom-megatron-deepspeed) * [GLM (130B)](https://github.com/THUDM/GLM-130B) * [xTrimoPGLM (100B)](https://www.biorxiv.org/content/10.1101/2023.07.05.547496v2) * [YaLM (100B)](https://github.com/yandex/YaLM-100B) * [GPT-NeoX (20B)](https://github.com/EleutherAI/gpt-neox) * [AlexaTM (20B)](https://www.amazon.science/blog/20b-parameter-alexa-model-sets-new-marks-in-few-shot-learning) * [Turing NLG (17B)](https://www.microsoft.com/en-us/research/blog/turing-nlg-a-17-billion-parameter-language-model-by-microsoft/) * [METRO-LM (5.4B)](https://arxiv.org/pdf/2204.06644.pdf)
DeepSpeed has been integrated with several different popular open-source DL frameworks such as:
| | Documentation || ---------------------------------------------------------------------------------------------- | -------------------------------------------- |<img src="docs/assets/images/transformers-light.png#gh-light-mode-only" width="250px"><img src="docs/assets/images/transformers-dark.png#gh-dark-mode-only" width="250px"> | [Transformers with DeepSpeed](https://huggingface.co/docs/transformers/deepspeed) || <img src="docs/assets/images/accelerate-light.png#gh-light-mode-only" width="250px"><img src="docs/assets/images/accelerate-dark.png#gh-dark-mode-only" width="250px"> | [Accelerate with DeepSpeed](https://huggingface.co/docs/accelerate/usage_guides/deepspeed) || <img src="docs/assets/images/lightning-light.svg#gh-light-mode-only" width="200px"><img src="docs/assets/images/lightning-dark.svg#gh-dark-mode-only" width="200px"> | [Lightning with DeepSpeed](https://lightning.ai/docs/pytorch/stable/advanced/model_parallel.html#deepspeed) || <img src="docs/assets/images/mosaicml.svg" width="200px"> | [MosaicML with DeepSpeed](https://docs.mosaicml.com/projects/composer/en/latest/trainer/using_the_trainer.html?highlight=deepspeed#deepspeed-integration) || <img src="docs/assets/images/determined.svg" width="225px"> | [Determined with DeepSpeed](https://docs.determined.ai/latest/training/apis-howto/deepspeed/overview.html) || <img src="https://user-images.githubusercontent.com/58739961/187154444-fce76639-ac8d-429b-9354-c6fac64b7ef8.jpg" width=150> | [MMEngine with DeepSpeed](https://mmengine.readthedocs.io/en/latest/common_usage/large_model_training.html#deepspeed) |
---
# Build Pipeline Status
| Description | Status || ----------- | ------ || NVIDIA | [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-torch110-p40.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-torch110-v100.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-torch-latest-v100.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-h100.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-inference.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-nightly.yml) || AMD | [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/amd-mi200.yml) || CPU | [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/cpu-torch-latest.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/cpu-inference.yml) || Intel Gaudi | [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/hpu-gaudi2.yml) || Intel XPU | [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/xpu-max1100.yml) || PyTorch Nightly | [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-torch-nightly-v100.yml) || Integrations | [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-transformers-v100.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-lightning-v100.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-accelerate-v100.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-mii.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-ds-chat.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/nv-sd.yml) || Misc | [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/formatting.yml) [](https://github.com/deepspeedai/DeepSpeed/actions/workflows/pages/pages-build-deployment) [](https://deepspeed.readthedocs.io/en/latest/?badge=latest)[](https://github.com/deepspeedai/DeepSpeed/actions/workflows/python.yml) || Huawei Ascend NPU | [](https://github.com/Ascend/Ascend-CI/actions/workflows/deepspeed.yaml) |
# Installation
The quickest way to get started with DeepSpeed is via pip, this will installthe latest release of DeepSpeed which is not tied to specific PyTorch or CUDAversions. DeepSpeed includes several C++/CUDA extensions that we commonly referto as our 'ops'. By default, all of these extensions/ops will be builtjust-in-time (JIT) using [torch's JIT C++ extension loader that relies onninja](https://pytorch.org/docs/stable/cpp_extension.html) to build anddynamically link them at runtime.
## Requirements* [PyTorch](https://pytorch.org/) must be installed _before_ installing DeepSpeed.* For full feature support we recommend a version of PyTorch that is >= 1.9 and ideally the latest PyTorch stable release.* A CUDA or ROCm compiler such as [nvcc](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#introduction) or [hipcc](https://github.com/ROCm-Developer-Tools/HIPCC) used to compile C++/CUDA/HIP extensions.* Specific GPUs we develop and test against are listed below, this doesn't mean your GPU will not work if it doesn't fall into this category it's just DeepSpeed is most well tested on the following: * NVIDIA: Pascal, Volta, Ampere, and Hopper architectures * AMD: MI100 and MI200
## Contributed HW support* DeepSpeed now support various HW accelerators.
| Contributor | Hardware | Accelerator Name | Contributor validated | Upstream validated ||-------------|-------------------------------------|------------------| --------------------- |--------------------|| Huawei | Huawei Ascend NPU | npu | Yes | No || Intel | Intel(R) Gaudi(R) 2 AI accelerator | hpu | Yes | Yes || Intel | Intel(R) Xeon(R) Processors | cpu | Yes | Yes || Intel | Intel(R) Data Center GPU Max series | xpu | Yes | Yes || Tecorigin | Scalable Data Analytics Accelerator | sdaa | Yes | No |
## PyPIWe regularly push releases to [PyPI](https://pypi.org/project/deepspeed/) and encourage users to install from there in most cases.
```bashpip install deepspeed```
After installation, you can validate your install and see which extensions/opsyour machine is compatible with via the DeepSpeed environment report.
```bashds_report```
If you would like to pre-install any of the DeepSpeed extensions/ops (insteadof JIT compiling) or install pre-compiled ops via PyPI please see our [advancedinstallation instructions](https://www.deepspeed.ai/tutorials/advanced-install/).
## WindowsMany DeepSpeed features are supported on Windows for both training and inference. You can read more about this in the original blog post [here](https://github.com/deepspeedai/DeepSpeed/tree/master/blogs/windows/08-2024/README.md). Among features that are currently not supported are async io (AIO) and GDS (which does not support Windows).1. Install PyTorch, such as pytorch 2.3+cu121.2. Install Visual C++ build tools, such as VS2022 C++ x64/x86 build tools.3. Launch Cmd console with Administrator permissions for creating required symlink folders and ensure MSVC tools are added to your PATH or launch the Developer Command Prompt for Visual Studio 2022 with administrator permissions.4. Run `build_win.bat` to build wheel in `dist` folder.
# Features
Please checkout [DeepSpeed-Training](https://www.deepspeed.ai/training), [DeepSpeed-Inference](https://www.deepspeed.ai/inference) and [DeepSpeed-Compression](https://www.deepspeed.ai/compression) pages for full set of features offered along each of these three pillars.
# Further Reading
All DeepSpeed documentation, tutorials, and blogs can be found on our website: [deepspeed.ai](https://www.deepspeed.ai/)
| | Description || ---------------------------------------------------------------------------------------------- | -------------------------------------------- || [Getting Started](https://www.deepspeed.ai/getting-started/) | First steps with DeepSpeed || [DeepSpeed JSON Configuration](https://www.deepspeed.ai/docs/config-json/) | Configuring DeepSpeed || [API Documentation](https://deepspeed.readthedocs.io/en/latest/) | Generated DeepSpeed API documentation || [Tutorials](https://www.deepspeed.ai/tutorials/) | Tutorials || [Blogs](https://www.deepspeed.ai/posts/) | Blogs |
# ContributingDeepSpeed welcomes your contributions! Please see our[contributing](CONTRIBUTING.md) guide for more details on formatting, testing,etc.<br/>Thanks so much to all of our amazing contributors!
<a href="https://github.com/deepspeedai/DeepSpeed/graphs/contributors"> <img src="https://contrib.rocks/image?repo=microsoft/DeepSpeed&r=" width="800px"/></a>
## Contributor License AgreementThis project welcomes contributions and suggestions. Most contributions require you toagree to a Contributor License Agreement (CLA) declaring that you have the right to, andactually do, grant us the rights to use your contribution. For details, visithttps://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you needto provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simplyfollow the instructions provided by the bot. You will only need to do this once acrossall repos using our CLA.
## Code of ConductThis project has adopted the [Microsoft Open Source Code ofConduct](https://opensource.microsoft.com/codeofconduct/). For more information see the[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
# Publications1. Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Yuxiong He. (2019) ZeRO: memory optimizations toward training trillion parameter models. [arXiv:1910.02054](https://arxiv.org/abs/1910.02054) and [In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis (SC '20)](https://dl.acm.org/doi/10.5555/3433701.3433727).2. Jeff Rasley, Samyam Rajbhandari, Olatunji Ruwase, and Yuxiong He. (2020) DeepSpeed: System Optimizations Enable Training Deep Learning Models with Over 100 Billion Parameters. [In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD '20, Tutorial)](https://dl.acm.org/doi/10.1145/3394486.3406703).3. Minjia Zhang, Yuxiong He. (2020) Accelerating Training of Transformer-Based Language Models with Progressive Layer Dropping. [arXiv:2010.13369](https://arxiv.org/abs/2010.13369) and [NeurIPS 2020](https://proceedings.neurips.cc/paper/2020/hash/a1140a3d0df1c81e24ae954d935e8926-Abstract.html).4. Jie Ren, Samyam Rajbhandari, Reza Yazdani Aminabadi, Olatunji Ruwase, Shuangyan Yang, Minjia Zhang, Dong Li, Yuxiong He. (2021) ZeRO-Offload: Democratizing Billion-Scale Model Training. [arXiv:2101.06840](https://arxiv.org/abs/2101.06840) and [USENIX ATC 2021](https://www.usenix.org/conference/atc21/presentation/ren-jie). [[paper]](https://arxiv.org/abs/2101.06840) [[slides]](https://www.usenix.org/system/files/atc21_slides_ren-jie.pdf) [[blog]](https://www.microsoft.com/en-us/research/blog/deepspeed-extreme-scale-model-training-for-everyone/)5. Hanlin Tang, Shaoduo Gan, Ammar Ahmad Awan, Samyam Rajbhandari, Conglong Li, Xiangru Lian, Ji Liu, Ce Zhang, Yuxiong He. (2021) 1-bit Adam: Communication Efficient Large-Scale Training with Adam's Convergence Speed. [arXiv:2102.02888](https://arxiv.org/abs/2102.02888) and [ICML 2021](http://proceedings.mlr.press/v139/tang21a.html).6. Samyam Rajbhandari, Olatunji Ruwase, Jeff Rasley, Shaden Smith, Yuxiong He. (2021) ZeRO-Infinity: Breaking the GPU Memory Wall for Extreme Scale Deep Learning. [arXiv:2104.07857](https://arxiv.org/abs/2104.07857) and [SC 2021](https://dl.acm.org/doi/abs/10.1145/3458817.3476205). [[paper]](https://arxiv.org/abs/2104.07857) [[slides]](docs/assets/files/SC21-ZeRO-Infinity.pdf) [[blog]](https://www.microsoft.com/en-us/research/blog/zero-infinity-and-deepspeed-unlocking-unprecedented-model-scale-for-deep-learning-training/)7. Conglong Li, Ammar Ahmad Awan, Hanlin Tang, Samyam Rajbhandari, Yuxiong He. (2021) 1-bit LAMB: Communication Efficient Large-Scale Large-Batch Training with LAMB's Convergence Speed. [arXiv:2104.06069](https://arxiv.org/abs/2104.06069) and [HiPC 2022](https://hipc.org/advance-program/).8. Conglong Li, Minjia Zhang, Yuxiong He. (2021) The Stability-Efficiency Dilemma: Investigating Sequence Length Warmup for Training GPT Models. [arXiv:2108.06084](https://arxiv.org/abs/2108.06084) and [NeurIPS 2022](https://openreview.net/forum?id=JpZ5du_Kdh).9. Yucheng Lu, Conglong Li, Minjia Zhang, Christopher De Sa, Yuxiong He. (2022) Maximizing Communication Efficiency for Large-scale Training via 0/1 Adam. [arXiv:2202.06009](https://arxiv.org/abs/2202.06009).10. Samyam Rajbhandari, Conglong Li, Zhewei Yao, Minjia Zhang, Reza Yazdani Aminabadi, Ammar Ahmad Awan, Jeff Rasley, Yuxiong He. (2022) DeepSpeed-MoE: Advancing Mixture-of-Experts Inference and Training to Power Next-Generation AI Scale [arXiv:2201.05596](https://arxiv.org/abs/2201.05596) and [ICML 2022](https://proceedings.mlr.press/v162/rajbhandari22a.html). [[pdf]](https://arxiv.org/abs/2201.05596) [[slides]](docs/assets/files/ICML-5mins.pdf) [[blog]](https://www.microsoft.com/en-us/research/blog/deepspeed-advancing-moe-inference-and-training-to-power-next-generation-ai-scale/)11. Shaden Smith, Mostofa Patwary, Brandon Norick, Patrick LeGresley, Samyam Rajbhandari, Jared Casper, Zhun Liu, Shrimai Prabhumoye, George Zerveas, Vijay Korthikanti, Elton Zhang, Rewon Child, Reza Yazdani Aminabadi, Julie Bernauer, Xia Song, Mohammad Shoeybi, Yuxiong He, Michael Houston, Saurabh Tiwary, Bryan Catanzaro. (2022) Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, A Large-Scale Generative Language Model [arXiv:2201.11990](https://arxiv.org/abs/2201.11990).12. Xiaoxia Wu, Zhewei Yao, Minjia Zhang, Conglong Li, Yuxiong He. (2022) Extreme Compression for Pre-trained Transformers Made Simple and Efficient. [arXiv:2206.01859](https://arxiv.org/abs/2206.01859) and [NeurIPS 2022](https://openreview.net/forum?id=xNeAhc2CNAl).13. Zhewei Yao, Reza Yazdani Aminabadi, Minjia Zhang, Xiaoxia Wu, Conglong Li, Yuxiong He. (2022) ZeroQuant: Efficient and Affordable Post-Training Quantization for Large-Scale Transformers. [arXiv:2206.01861](https://arxiv.org/abs/2206.01861) and [NeurIPS 2022](https://openreview.net/forum?id=f-fVCElZ-G1) [[slides]](docs/assets/files/zeroquant_series.pdf) [[blog]](https://www.microsoft.com/en-us/research/blog/deepspeed-compression-a-composable-library-for-extreme-compression-and-zero-cost-quantization/)14. Reza Yazdani Aminabadi, Samyam Rajbhandari, Minjia Zhang, Ammar Ahmad Awan, Cheng Li, Du Li, Elton Zheng, Jeff Rasley, Shaden Smith, Olatunji Ruwase, Yuxiong He. (2022) DeepSpeed Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scale. [arXiv:2207.00032](https://arxiv.org/abs/2207.00032) and [SC 2022](https://dl.acm.org/doi/abs/10.5555/3571885.3571946). [[paper]](https://arxiv.org/abs/2207.00032) [[slides]](docs/assets/files/sc22-ds-inference.pdf) [[blog]](https://www.microsoft.com/en-us/research/blog/deepspeed-accelerating-large-scale-model-inference-and-training-via-system-optimizations-and-compression/)15. Zhewei Yao, Xiaoxia Wu, Conglong Li, Connor Holmes, Minjia Zhang, Cheng Li, Yuxiong He. (2022) Random-LTD: Random and Layerwise Token Dropping Brings Efficient Training for Large-scale Transformers. [arXiv:2211.11586](https://arxiv.org/abs/2211.11586).16. Conglong Li, Zhewei Yao, Xiaoxia Wu, Minjia Zhang, Yuxiong He. (2022) DeepSpeed Data Efficiency: Improving Deep Learning Model Quality and Training Efficiency via Efficient Data Sampling and Routing. [arXiv:2212.03597](https://arxiv.org/abs/2212.03597) [ENLSP2023 Workshop at NeurIPS2023](https://neurips2023-enlsp.github.io/)17. Xiaoxia Wu, Cheng Li, Reza Yazdani Aminabadi, Zhewei Yao, Yuxiong He. (2023) Understanding INT4 Quantization for Transformer Models: Latency Speedup, Composability, and Failure Cases. [arXiv:2301.12017](https://arxiv.org/abs/2301.12017) and [ICML2023](https://icml.cc/Conferences/2023).18. Syed Zawad, Cheng Li, Zhewei Yao, Elton Zheng, Yuxiong He, Feng Yan. (2023) DySR: Adaptive Super-Resolution via Algorithm and System Co-design. [ICLR:2023](https://openreview.net/forum?id=Pgtn4l6eKjv).19. Sheng Shen, Zhewei Yao, Chunyuan Li, Trevor Darrell, Kurt Keutzer, Yuxiong He. (2023) Scaling Vision-Language Models with Sparse Mixture of Experts. [arXiv:2303.07226](https://arxiv.org/abs/2303.07226) and [Finding at EMNLP2023](https://2023.emnlp.org/).20. Quentin Anthony, Ammar Ahmad Awan, Jeff Rasley, Yuxiong He, Aamir Shafi, Mustafa Abduljabbar, Hari Subramoni, Dhabaleswar Panda. (2023) MCR-DL: Mix-and-Match Communication Runtime for Deep Learning [arXiv:2303.08374](https://arxiv.org/abs/2303.08374) and will appear at IPDPS 2023.21. Siddharth Singh, Olatunji Ruwase, Ammar Ahmad Awan, Samyam Rajbhandari, Yuxiong He, Abhinav Bhatele. (2023) A Hybrid Tensor-Expert-Data Parallelism Approach to Optimize Mixture-of-Experts Training [arXiv:2303.06318](https://arxiv.org/abs/2303.06318) and [ICS 2023](https://dl.acm.org/doi/10.1145/3577193.3593704).22. Guanhua Wang, Heyang Qin, Sam Ade Jacobs, Xiaoxia Wu, Connor Holmes, Zhewei Yao, Samyam Rajbhandari, Olatunji Ruwase, Feng Yan, Lei Yang, Yuxiong He. (2023) ZeRO++: Extremely Efficient Collective Communication for Giant Model Training [arXiv:2306.10209](https://arxiv.org/abs/2306.10209) and [ML for Sys Workshop at NeurIPS2023](http://mlforsystems.org/) [[blog]](https://www.microsoft.com/en-us/research/blog/deepspeed-zero-a-leap-in-speed-for-llm-and-chat-model-training-with-4x-less-communication/)23. Zhewei Yao, Xiaoxia Wu, Cheng Li, Stephen Youn, Yuxiong He. (2023) ZeroQuant-V2: Exploring Post-training Quantization in LLMs from Comprehensive Study to Low Rank Compensation [arXiv:2303.08302](https://arxiv.org/abs/2303.08302) and [ENLSP2023 Workshop at NeurIPS2023](https://neurips2023-enlsp.github.io/) [[slides]](docs/assets/files/zeroquant_series.pdf)24. Pareesa Ameneh Golnari, Zhewei Yao, Yuxiong He. (2023) Selective Guidance: Are All the Denoising Steps of Guided Diffusion Important? [arXiv:2305.09847](https://arxiv.org/abs/2305.09847)25. Zhewei Yao, Reza Yazdani Aminabadi, Olatunji Ruwase, Samyam Rajbhandari, Xiaoxia Wu, Ammar Ahmad Awan, Jeff Rasley, Minjia Zhang, Conglong Li, Connor Holmes, Zhongzhu Zhou, Michael Wyatt, Molly Smith, Lev Kurilenko, Heyang Qin, Masahiro Tanaka, Shuai Che, Shuaiwen Leon Song, Yuxiong He. (2023) DeepSpeed-Chat: Easy, Fast and Affordable RLHF Training of ChatGPT-like Models at All Scales [arXiv:2308.01320](https://arxiv.org/abs/2308.01320).26. Xiaoxia Wu, Zhewei Yao, Yuxiong He. (2023) ZeroQuant-FP: A Leap Forward in LLMs Post-Training W4A8 Quantization Using Floating-Point Formats [arXiv:2307.09782](https://arxiv.org/abs/2307.09782) and [ENLSP2023 Workshop at NeurIPS2023](https://neurips2023-enlsp.github.io/) [[slides]](docs/assets/files/zeroquant_series.pdf)27. Zhewei Yao, Xiaoxia Wu, Conglong Li, Minjia Zhang, Heyang Qin, Olatunji Ruwase, Ammar Ahmad Awan, Samyam Rajbhandari, Yuxiong He. (2023) DeepSpeed-VisualChat: Multi-Round Multi-Image Interleave Chat via Multi-Modal Causal Attention [arXiv:2309.14327](https://arxiv.org/pdf/2309.14327.pdf)28. Shuaiwen Leon Song, Bonnie Kruft, Minjia Zhang, Conglong Li, Shiyang Chen, Chengming Zhang, Masahiro Tanaka, Xiaoxia Wu, Jeff Rasley, Ammar Ahmad Awan, Connor Holmes, Martin Cai, Adam Ghanem, Zhongzhu Zhou, Yuxiong He, et al. (2023) DeepSpeed4Science Initiative: Enabling Large-Scale Scientific Discovery through Sophisticated AI System Technologies [arXiv:2310.04610](https://arxiv.org/abs/2310.04610) [[blog]](https://www.microsoft.com/en-us/research/blog/announcing-the-deepspeed4science-initiative-enabling-large-scale-scientific-discovery-through-sophisticated-ai-system-technologies/)29. Zhewei Yao, Reza Yazdani Aminabadi, Stephen Youn, Xiaoxia Wu, Elton Zheng, Yuxiong He. (2023) ZeroQuant-HERO: Hardware-Enhanced Robust Optimized Post-Training Quantization Framework for W8A8 Transformers [arXiv:2310.17723](https://arxiv.org/abs/2310.17723)
30. Xiaoxia Wu, Haojun Xia, Stephen Youn, Zhen Zheng, Shiyang Chen, Arash Bakhtiari, Michael Wyatt, Reza Yazdani Aminabadi, Yuxiong He, Olatunji Ruwase, Leon Song, Zhewei Yao (2023) ZeroQuant(4+2): Redefining LLMs Quantization with a New FP6-Centric Strategy for Diverse Generative Tasks [arXiv:2312.08583](https://arxiv.org/abs/2312.08583)
31. Haojun Xia, Zhen Zheng, Xiaoxia Wu, Shiyang Chen, Zhewei Yao, Stephen Youn, Arash Bakhtiari, Michael Wyatt, Donglin Zhuang, Zhongzhu Zhou, Olatunji Ruwase, Yuxiong He, Shuaiwen Leon Song. (2024) FP6-LLM: Efficiently Serving Large Language Models Through FP6-Centric Algorithm-System Co-Design [arXiv:2401.14112](https://arxiv.org/abs/2401.14112)32. Sam Ade Jacobs, Masahiro Tanaka, Chengming Zhang, Minjia Zhang, Reza Yazdani Aminadabi, Shuaiwen Leon Song, Samyam Rajbhandari, Yuxiong He. (2024) [System Optimizations for Enabling Training of Extreme Long Sequence Transformer Models](https://dl.acm.org/doi/10.1145/3662158.3662806)33. Xinyu Lian, Sam Ade Jacobs, Lev Kurilenko, Masahiro Tanaka, Stas Bekman, Olatunji Ruwase, Minjia Zhang. (2024) Universal Checkpointing: Efficient and Flexible Checkpointing for Large Scale Distributed Training [arXiv:2406.18820](https://arxiv.org/abs/2406.18820)
# Videos1. DeepSpeed KDD 2020 Tutorial 1. [Overview](https://www.youtube.com/watch?v=CaseqC45DNc&list=PLa85ZdUjfWS21mgibJ2vCvLziprjpKoW0&index=29) 2. [ZeRO + large model training](https://www.youtube.com/watch?v=y4_bCiAsIAk&list=PLa85ZdUjfWS21mgibJ2vCvLziprjpKoW0&index=28) 3. [17B T-NLG demo](https://www.youtube.com/watch?v=9V-ZbP92drg&list=PLa85ZdUjfWS21mgibJ2vCvLziprjpKoW0&index=27) 4. [Fastest BERT training + RScan tuning](https://www.youtube.com/watch?v=o1K-ZG9F6u0&list=PLa85ZdUjfWS21mgibJ2vCvLziprjpKoW0&index=26) 5. DeepSpeed hands on deep dive: [part 1](https://www.youtube.com/watch?v=_NOk-mBwDYg&list=PLa85ZdUjfWS21mgibJ2vCvLziprjpKoW0&index=92), [part 2](https://www.youtube.com/watch?v=sG6_c4VXLww&list=PLa85ZdUjfWS21mgibJ2vCvLziprjpKoW0&index=94), [part 3](https://www.youtube.com/watch?v=k9yPkBTayos&list=PLa85ZdUjfWS21mgibJ2vCvLziprjpKoW0&index=93) 6. [FAQ](https://www.youtube.com/watch?v=nsHu6vEgPew&list=PLa85ZdUjfWS21mgibJ2vCvLziprjpKoW0&index=24)2. Microsoft Research Webinar * Registration is free and all videos are available on-demand. * [ZeRO & Fastest BERT: Increasing the scale and speed of deep learning training in DeepSpeed](https://note.microsoft.com/MSR-Webinar-DeepSpeed-Registration-On-Demand.html).3. [DeepSpeed on AzureML](https://youtu.be/yBVXR8G8Bg8)4. [Large Model Training and Inference with DeepSpeed // Samyam Rajbhandari // LLMs in Prod Conference](https://www.youtube.com/watch?v=cntxC3g22oU) [[slides]](docs/assets/files/presentation-mlops.pdf)5. Community Tutorials * [DeepSpeed: All the tricks to scale to gigantic models (Mark Saroufim)](https://www.youtube.com/watch?v=pDGI668pNg0) * [Turing-NLG, DeepSpeed and the ZeRO optimizer (Yannic Kilcher)](https://www.youtube.com/watch?v=tC01FRB0M7w) * [Ultimate Guide To Scaling ML Models (The AI Epiphany)](https://www.youtube.com/watch?v=hc0u4avAkuM)12345Wheel-Version: 1.0Generator: setuptools (80.10.2)Root-Is-Purelib: trueTag: py3-none-any
12[pytest_randomly.random_seeder]deepspeed = deepspeed.runtime.utils:set_random_seed123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.1deepspeed123version https://git-lfs.github.com/spec/v1oid sha256:2638ce9e2500e572a5e0de7faed6661eb569d1b696fcba07b0dd223da5f5d224size 15112345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970"""A platform independent file lock that supports the with-statement.
.. autodata:: filelock.__version__ :no-value:
"""
from __future__ import annotations
import sysimport warningsfrom typing import TYPE_CHECKING
from ._api import AcquireReturnProxy, BaseFileLockfrom ._error import Timeoutfrom ._soft import SoftFileLockfrom ._unix import UnixFileLock, has_fcntlfrom ._windows import WindowsFileLockfrom .asyncio import ( AsyncAcquireReturnProxy, AsyncSoftFileLock, AsyncUnixFileLock, AsyncWindowsFileLock, BaseAsyncFileLock,)from .version import version
#: version of the project as a string__version__: str = version
if sys.platform == "win32": # pragma: win32 cover _FileLock: type[BaseFileLock] = WindowsFileLock _AsyncFileLock: type[BaseAsyncFileLock] = AsyncWindowsFileLockelse: # pragma: win32 no cover # noqa: PLR5501 if has_fcntl: _FileLock: type[BaseFileLock] = UnixFileLock _AsyncFileLock: type[BaseAsyncFileLock] = AsyncUnixFileLock else: _FileLock = SoftFileLock _AsyncFileLock = AsyncSoftFileLock if warnings is not None: warnings.warn("only soft file lock is available", stacklevel=2)
if TYPE_CHECKING: FileLock = SoftFileLock AsyncFileLock = AsyncSoftFileLockelse: #: Alias for the lock, which should be used for the current platform. FileLock = _FileLock AsyncFileLock = _AsyncFileLock
__all__ = [ "AcquireReturnProxy", "AsyncAcquireReturnProxy", "AsyncFileLock", "AsyncSoftFileLock", "AsyncUnixFileLock", "AsyncWindowsFileLock", "BaseAsyncFileLock", "BaseFileLock", "FileLock", "SoftFileLock", "Timeout", "UnixFileLock", "WindowsFileLock", "__version__",]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403from __future__ import annotations
import contextlibimport inspectimport loggingimport osimport timeimport warningsfrom abc import ABCMeta, abstractmethodfrom dataclasses import dataclassfrom threading import localfrom typing import TYPE_CHECKING, Any, castfrom weakref import WeakValueDictionary
from ._error import Timeout
if TYPE_CHECKING: import sys from types import TracebackType
if sys.version_info >= (3, 11): # pragma: no cover (py311+) from typing import Self else: # pragma: no cover (<py311) from typing_extensions import Self
_LOGGER = logging.getLogger("filelock")
# This is a helper class which is returned by :meth:`BaseFileLock.acquire` and wraps the lock to make sure __enter__# is not called twice when entering the with statement. If we would simply return *self*, the lock would be acquired# again in the *__enter__* method of the BaseFileLock, but not released again automatically. issue #37 (memory leak)class AcquireReturnProxy: """A context-aware object that will release the lock file when exiting."""
def __init__(self, lock: BaseFileLock) -> None: self.lock = lock
def __enter__(self) -> BaseFileLock: return self.lock
def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, ) -> None: self.lock.release()
@dataclassclass FileLockContext: """A dataclass which holds the context for a ``BaseFileLock`` object."""
# The context is held in a separate class to allow optional use of thread local storage via the # ThreadLocalFileContext class.
#: The path to the lock file. lock_file: str
#: The default timeout value. timeout: float
#: The mode for the lock files mode: int
#: Whether the lock should be blocking or not blocking: bool
#: The file descriptor for the *_lock_file* as it is returned by the os.open() function, not None when lock held lock_file_fd: int | None = None
#: The lock counter is used for implementing the nested locking mechanism. lock_counter: int = 0 # When the lock is acquired is increased and the lock is only released, when this value is 0
class ThreadLocalFileContext(FileLockContext, local): """A thread local version of the ``FileLockContext`` class."""
class FileLockMeta(ABCMeta): def __call__( # noqa: PLR0913 cls, lock_file: str | os.PathLike[str], timeout: float = -1, mode: int = 0o644, thread_local: bool = True, # noqa: FBT001, FBT002 *, blocking: bool = True, is_singleton: bool = False, **kwargs: Any, # capture remaining kwargs for subclasses # noqa: ANN401 ) -> BaseFileLock: if is_singleton: instance = cls._instances.get(str(lock_file)) # type: ignore[attr-defined] if instance: params_to_check = { "thread_local": (thread_local, instance.is_thread_local()), "timeout": (timeout, instance.timeout), "mode": (mode, instance.mode), "blocking": (blocking, instance.blocking), }
non_matching_params = { name: (passed_param, set_param) for name, (passed_param, set_param) in params_to_check.items() if passed_param != set_param } if not non_matching_params: return cast("BaseFileLock", instance)
# parameters do not match; raise error msg = "Singleton lock instances cannot be initialized with differing arguments" msg += "\nNon-matching arguments: " for param_name, (passed_param, set_param) in non_matching_params.items(): msg += f"\n\t{param_name} (existing lock has {set_param} but {passed_param} was passed)" raise ValueError(msg)
# Workaround to make `__init__`'s params optional in subclasses # E.g. virtualenv changes the signature of the `__init__` method in the `BaseFileLock` class descendant # (https://github.com/tox-dev/filelock/pull/340)
all_params = { "timeout": timeout, "mode": mode, "thread_local": thread_local, "blocking": blocking, "is_singleton": is_singleton, **kwargs, }
present_params = inspect.signature(cls.__init__).parameters # type: ignore[misc] init_params = {key: value for key, value in all_params.items() if key in present_params}
instance = super().__call__(lock_file, **init_params)
if is_singleton: cls._instances[str(lock_file)] = instance # type: ignore[attr-defined]
return cast("BaseFileLock", instance)
class BaseFileLock(contextlib.ContextDecorator, metaclass=FileLockMeta): """Abstract base class for a file lock object."""
_instances: WeakValueDictionary[str, BaseFileLock]
def __init_subclass__(cls, **kwargs: dict[str, Any]) -> None: """Setup unique state for lock subclasses.""" super().__init_subclass__(**kwargs) cls._instances = WeakValueDictionary()
def __init__( # noqa: PLR0913 self, lock_file: str | os.PathLike[str], timeout: float = -1, mode: int = 0o644, thread_local: bool = True, # noqa: FBT001, FBT002 *, blocking: bool = True, is_singleton: bool = False, ) -> None: """ Create a new lock object.
:param lock_file: path to the file :param timeout: default timeout when acquiring the lock, in seconds. It will be used as fallback value in \ the acquire method, if no timeout value (``None``) is given. If you want to disable the timeout, set it \ to a negative value. A timeout of 0 means that there is exactly one attempt to acquire the file lock. :param mode: file permissions for the lockfile :param thread_local: Whether this object's internal context should be thread local or not. If this is set to \ ``False`` then the lock will be reentrant across threads. :param blocking: whether the lock should be blocking or not :param is_singleton: If this is set to ``True`` then only one instance of this class will be created \ per lock file. This is useful if you want to use the lock object for reentrant locking without needing \ to pass the same object around.
""" self._is_thread_local = thread_local self._is_singleton = is_singleton
# Create the context. Note that external code should not work with the context directly and should instead use # properties of this class. kwargs: dict[str, Any] = { "lock_file": os.fspath(lock_file), "timeout": timeout, "mode": mode, "blocking": blocking, } self._context: FileLockContext = (ThreadLocalFileContext if thread_local else FileLockContext)(**kwargs)
def is_thread_local(self) -> bool: """:return: a flag indicating if this lock is thread local or not""" return self._is_thread_local
@property def is_singleton(self) -> bool: """:return: a flag indicating if this lock is singleton or not""" return self._is_singleton
@property def lock_file(self) -> str: """:return: path to the lock file""" return self._context.lock_file
@property def timeout(self) -> float: """ :return: the default timeout value, in seconds
.. versionadded:: 2.0.0 """ return self._context.timeout
@timeout.setter def timeout(self, value: float | str) -> None: """ Change the default timeout value.
:param value: the new value, in seconds
""" self._context.timeout = float(value)
@property def blocking(self) -> bool: """:return: whether the locking is blocking or not""" return self._context.blocking
@blocking.setter def blocking(self, value: bool) -> None: """ Change the default blocking value.
:param value: the new value as bool
""" self._context.blocking = value
@property def mode(self) -> int: """:return: the file permissions for the lockfile""" return self._context.mode
@abstractmethod def _acquire(self) -> None: """If the file lock could be acquired, self._context.lock_file_fd holds the file descriptor of the lock file.""" raise NotImplementedError
@abstractmethod def _release(self) -> None: """Releases the lock and sets self._context.lock_file_fd to None.""" raise NotImplementedError
@property def is_locked(self) -> bool: """
:return: A boolean indicating if the lock file is holding the lock currently.
.. versionchanged:: 2.0.0
This was previously a method and is now a property. """ return self._context.lock_file_fd is not None
@property def lock_counter(self) -> int: """:return: The number of times this lock has been acquired (but not yet released).""" return self._context.lock_counter
def acquire( self, timeout: float | None = None, poll_interval: float = 0.05, *, poll_intervall: float | None = None, blocking: bool | None = None, ) -> AcquireReturnProxy: """ Try to acquire the file lock.
:param timeout: maximum wait time for acquiring the lock, ``None`` means use the default :attr:`~timeout` is and if ``timeout < 0``, there is no timeout and this method will block until the lock could be acquired :param poll_interval: interval of trying to acquire the lock file :param poll_intervall: deprecated, kept for backwards compatibility, use ``poll_interval`` instead :param blocking: defaults to True. If False, function will return immediately if it cannot obtain a lock on the first attempt. Otherwise, this method will block until the timeout expires or the lock is acquired. :raises Timeout: if fails to acquire lock within the timeout period :return: a context object that will unlock the file when the context is exited
.. code-block:: python
# You can use this method in the context manager (recommended) with lock.acquire(): pass
# Or use an equivalent try-finally construct: lock.acquire() try: pass finally: lock.release()
.. versionchanged:: 2.0.0
This method returns now a *proxy* object instead of *self*, so that it can be used in a with statement without side effects.
""" # Use the default timeout, if no timeout is provided. if timeout is None: timeout = self._context.timeout
if blocking is None: blocking = self._context.blocking
if poll_intervall is not None: msg = "use poll_interval instead of poll_intervall" warnings.warn(msg, DeprecationWarning, stacklevel=2) poll_interval = poll_intervall
# Increment the number right at the beginning. We can still undo it, if something fails. self._context.lock_counter += 1
lock_id = id(self) lock_filename = self.lock_file start_time = time.perf_counter() try: while True: if not self.is_locked: _LOGGER.debug("Attempting to acquire lock %s on %s", lock_id, lock_filename) self._acquire() if self.is_locked: _LOGGER.debug("Lock %s acquired on %s", lock_id, lock_filename) break if blocking is False: _LOGGER.debug("Failed to immediately acquire lock %s on %s", lock_id, lock_filename) raise Timeout(lock_filename) # noqa: TRY301 if 0 <= timeout < time.perf_counter() - start_time: _LOGGER.debug("Timeout on acquiring lock %s on %s", lock_id, lock_filename) raise Timeout(lock_filename) # noqa: TRY301 msg = "Lock %s not acquired on %s, waiting %s seconds ..." _LOGGER.debug(msg, lock_id, lock_filename, poll_interval) time.sleep(poll_interval) except BaseException: # Something did go wrong, so decrement the counter. self._context.lock_counter = max(0, self._context.lock_counter - 1) raise return AcquireReturnProxy(lock=self)
def release(self, force: bool = False) -> None: # noqa: FBT001, FBT002 """ Releases the file lock. Please note, that the lock is only completely released, if the lock counter is 0. Also note, that the lock file itself is not automatically deleted.
:param force: If true, the lock counter is ignored and the lock is released in every case/
""" if self.is_locked: self._context.lock_counter -= 1
if self._context.lock_counter == 0 or force: lock_id, lock_filename = id(self), self.lock_file
_LOGGER.debug("Attempting to release lock %s on %s", lock_id, lock_filename) self._release() self._context.lock_counter = 0 _LOGGER.debug("Lock %s released on %s", lock_id, lock_filename)
def __enter__(self) -> Self: """ Acquire the lock.
:return: the lock object
""" self.acquire() return self
def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, ) -> None: """ Release the lock.
:param exc_type: the exception type if raised :param exc_value: the exception value if raised :param traceback: the exception traceback if raised
""" self.release()
def __del__(self) -> None: """Called when the lock object is deleted.""" self.release(force=True)
__all__ = [ "AcquireReturnProxy", "BaseFileLock",]123456789101112131415161718192021222324252627282930from __future__ import annotations
from typing import Any
class Timeout(TimeoutError): # noqa: N818 """Raised when the lock could not be acquired in *timeout* seconds."""
def __init__(self, lock_file: str) -> None: super().__init__() self._lock_file = lock_file
def __reduce__(self) -> str | tuple[Any, ...]: return self.__class__, (self._lock_file,) # Properly pickle the exception
def __str__(self) -> str: return f"The file lock '{self._lock_file}' could not be acquired."
def __repr__(self) -> str: return f"{self.__class__.__name__}({self.lock_file!r})"
@property def lock_file(self) -> str: """:return: The path of the file lock.""" return self._lock_file
__all__ = [ "Timeout",]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647from __future__ import annotations
import osimport sysfrom contextlib import suppressfrom errno import EACCES, EEXISTfrom pathlib import Path
from ._api import BaseFileLockfrom ._util import ensure_directory_exists, raise_on_not_writable_file
class SoftFileLock(BaseFileLock): """Simply watches the existence of the lock file."""
def _acquire(self) -> None: raise_on_not_writable_file(self.lock_file) ensure_directory_exists(self.lock_file) # first check for exists and read-only mode as the open will mask this case as EEXIST flags = ( os.O_WRONLY # open for writing only | os.O_CREAT | os.O_EXCL # together with above raise EEXIST if the file specified by filename exists | os.O_TRUNC # truncate the file to zero byte ) try: file_handler = os.open(self.lock_file, flags, self._context.mode) except OSError as exception: # re-raise unless expected exception if not ( exception.errno == EEXIST # lock already exist or (exception.errno == EACCES and sys.platform == "win32") # has no access to this lock ): # pragma: win32 no cover raise else: self._context.lock_file_fd = file_handler
def _release(self) -> None: assert self._context.lock_file_fd is not None # noqa: S101 os.close(self._context.lock_file_fd) # the lock file is definitely not None self._context.lock_file_fd = None with suppress(OSError): # the file is already deleted and that's what we want Path(self.lock_file).unlink()
__all__ = [ "SoftFileLock",]12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970from __future__ import annotations
import osimport sysfrom contextlib import suppressfrom errno import ENOSYSfrom pathlib import Pathfrom typing import cast
from ._api import BaseFileLockfrom ._util import ensure_directory_exists
#: a flag to indicate if the fcntl API is availablehas_fcntl = Falseif sys.platform == "win32": # pragma: win32 cover
class UnixFileLock(BaseFileLock): """Uses the :func:`fcntl.flock` to hard lock the lock file on unix systems."""
def _acquire(self) -> None: raise NotImplementedError
def _release(self) -> None: raise NotImplementedError
else: # pragma: win32 no cover try: import fcntl
_ = (fcntl.flock, fcntl.LOCK_EX, fcntl.LOCK_NB, fcntl.LOCK_UN) except (ImportError, AttributeError): pass else: has_fcntl = True
class UnixFileLock(BaseFileLock): """Uses the :func:`fcntl.flock` to hard lock the lock file on unix systems."""
def _acquire(self) -> None: ensure_directory_exists(self.lock_file) open_flags = os.O_RDWR | os.O_TRUNC if not Path(self.lock_file).exists(): open_flags |= os.O_CREAT fd = os.open(self.lock_file, open_flags, self._context.mode) with suppress(PermissionError): # This locked is not owned by this UID os.fchmod(fd, self._context.mode) try: fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) except OSError as exception: os.close(fd) if exception.errno == ENOSYS: # NotImplemented error msg = "FileSystem does not appear to support flock; use SoftFileLock instead" raise NotImplementedError(msg) from exception else: self._context.lock_file_fd = fd
def _release(self) -> None: # Do not remove the lockfile: # https://github.com/tox-dev/py-filelock/issues/31 # https://stackoverflow.com/questions/17708885/flock-removing-locked-file-without-race-condition fd = cast("int", self._context.lock_file_fd) self._context.lock_file_fd = None fcntl.flock(fd, fcntl.LOCK_UN) os.close(fd)
__all__ = [ "UnixFileLock", "has_fcntl",]12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152from __future__ import annotations
import osimport statimport sysfrom errno import EACCES, EISDIRfrom pathlib import Path
def raise_on_not_writable_file(filename: str) -> None: """ Raise an exception if attempting to open the file for writing would fail.
This is done so files that will never be writable can be separated from files that are writable but currently locked.
:param filename: file to check :raises OSError: as if the file was opened for writing.
""" try: # use stat to do exists + can write to check without race condition file_stat = os.stat(filename) # noqa: PTH116 except OSError: return # swallow does not exist or other errors
if file_stat.st_mtime != 0: # if os.stat returns but modification is zero that's an invalid os.stat - ignore it if not (file_stat.st_mode & stat.S_IWUSR): raise PermissionError(EACCES, "Permission denied", filename)
if stat.S_ISDIR(file_stat.st_mode): if sys.platform == "win32": # pragma: win32 cover # On Windows, this is PermissionError raise PermissionError(EACCES, "Permission denied", filename) else: # pragma: win32 no cover # noqa: RET506 # On linux / macOS, this is IsADirectoryError raise IsADirectoryError(EISDIR, "Is a directory", filename)
def ensure_directory_exists(filename: Path | str) -> None: """ Ensure the directory containing the file exists (create it if necessary).
:param filename: file.
""" Path(filename).parent.mkdir(parents=True, exist_ok=True)
__all__ = [ "ensure_directory_exists", "raise_on_not_writable_file",]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465from __future__ import annotations
import osimport sysfrom contextlib import suppressfrom errno import EACCESfrom pathlib import Pathfrom typing import cast
from ._api import BaseFileLockfrom ._util import ensure_directory_exists, raise_on_not_writable_file
if sys.platform == "win32": # pragma: win32 cover import msvcrt
class WindowsFileLock(BaseFileLock): """Uses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems."""
def _acquire(self) -> None: raise_on_not_writable_file(self.lock_file) ensure_directory_exists(self.lock_file) flags = ( os.O_RDWR # open for read and write | os.O_CREAT # create file if not exists | os.O_TRUNC # truncate file if not empty ) try: fd = os.open(self.lock_file, flags, self._context.mode) except OSError as exception: if exception.errno != EACCES: # has no access to this lock raise else: try: msvcrt.locking(fd, msvcrt.LK_NBLCK, 1) except OSError as exception: os.close(fd) # close file first if exception.errno != EACCES: # file is already locked raise else: self._context.lock_file_fd = fd
def _release(self) -> None: fd = cast("int", self._context.lock_file_fd) self._context.lock_file_fd = None msvcrt.locking(fd, msvcrt.LK_UNLCK, 1) os.close(fd)
with suppress(OSError): # Probably another instance of the application hat acquired the file lock. Path(self.lock_file).unlink()
else: # pragma: win32 no cover
class WindowsFileLock(BaseFileLock): """Uses the :func:`msvcrt.locking` function to hard lock the lock file on Windows systems."""
def _acquire(self) -> None: raise NotImplementedError
def _release(self) -> None: raise NotImplementedError
__all__ = [ "WindowsFileLock",]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342"""An asyncio-based implementation of the file lock."""
from __future__ import annotations
import asyncioimport contextlibimport loggingimport osimport timefrom dataclasses import dataclassfrom threading import localfrom typing import TYPE_CHECKING, Any, Callable, NoReturn, cast
from ._api import BaseFileLock, FileLockContext, FileLockMetafrom ._error import Timeoutfrom ._soft import SoftFileLockfrom ._unix import UnixFileLockfrom ._windows import WindowsFileLock
if TYPE_CHECKING: import sys from concurrent import futures from types import TracebackType
if sys.version_info >= (3, 11): # pragma: no cover (py311+) from typing import Self else: # pragma: no cover (<py311) from typing_extensions import Self
_LOGGER = logging.getLogger("filelock")
@dataclassclass AsyncFileLockContext(FileLockContext): """A dataclass which holds the context for a ``BaseAsyncFileLock`` object."""
#: Whether run in executor run_in_executor: bool = True
#: The executor executor: futures.Executor | None = None
#: The loop loop: asyncio.AbstractEventLoop | None = None
class AsyncThreadLocalFileContext(AsyncFileLockContext, local): """A thread local version of the ``FileLockContext`` class."""
class AsyncAcquireReturnProxy: """A context-aware object that will release the lock file when exiting."""
def __init__(self, lock: BaseAsyncFileLock) -> None: # noqa: D107 self.lock = lock
async def __aenter__(self) -> BaseAsyncFileLock: # noqa: D105 return self.lock
async def __aexit__( # noqa: D105 self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, ) -> None: await self.lock.release()
class AsyncFileLockMeta(FileLockMeta): def __call__( # type: ignore[override] # noqa: PLR0913 cls, # noqa: N805 lock_file: str | os.PathLike[str], timeout: float = -1, mode: int = 0o644, thread_local: bool = False, # noqa: FBT001, FBT002 *, blocking: bool = True, is_singleton: bool = False, loop: asyncio.AbstractEventLoop | None = None, run_in_executor: bool = True, executor: futures.Executor | None = None, ) -> BaseAsyncFileLock: if thread_local and run_in_executor: msg = "run_in_executor is not supported when thread_local is True" raise ValueError(msg) instance = super().__call__( lock_file=lock_file, timeout=timeout, mode=mode, thread_local=thread_local, blocking=blocking, is_singleton=is_singleton, loop=loop, run_in_executor=run_in_executor, executor=executor, ) return cast("BaseAsyncFileLock", instance)
class BaseAsyncFileLock(BaseFileLock, metaclass=AsyncFileLockMeta): """Base class for asynchronous file locks."""
def __init__( # noqa: PLR0913 self, lock_file: str | os.PathLike[str], timeout: float = -1, mode: int = 0o644, thread_local: bool = False, # noqa: FBT001, FBT002 *, blocking: bool = True, is_singleton: bool = False, loop: asyncio.AbstractEventLoop | None = None, run_in_executor: bool = True, executor: futures.Executor | None = None, ) -> None: """ Create a new lock object.
:param lock_file: path to the file :param timeout: default timeout when acquiring the lock, in seconds. It will be used as fallback value in \ the acquire method, if no timeout value (``None``) is given. If you want to disable the timeout, set it \ to a negative value. A timeout of 0 means that there is exactly one attempt to acquire the file lock. :param mode: file permissions for the lockfile :param thread_local: Whether this object's internal context should be thread local or not. If this is set to \ ``False`` then the lock will be reentrant across threads. :param blocking: whether the lock should be blocking or not :param is_singleton: If this is set to ``True`` then only one instance of this class will be created \ per lock file. This is useful if you want to use the lock object for reentrant locking without needing \ to pass the same object around. :param loop: The event loop to use. If not specified, the running event loop will be used. :param run_in_executor: If this is set to ``True`` then the lock will be acquired in an executor. :param executor: The executor to use. If not specified, the default executor will be used.
""" self._is_thread_local = thread_local self._is_singleton = is_singleton
# Create the context. Note that external code should not work with the context directly and should instead use # properties of this class. kwargs: dict[str, Any] = { "lock_file": os.fspath(lock_file), "timeout": timeout, "mode": mode, "blocking": blocking, "loop": loop, "run_in_executor": run_in_executor, "executor": executor, } self._context: AsyncFileLockContext = (AsyncThreadLocalFileContext if thread_local else AsyncFileLockContext)( **kwargs )
@property def run_in_executor(self) -> bool: """::return: whether run in executor.""" return self._context.run_in_executor
@property def executor(self) -> futures.Executor | None: """::return: the executor.""" return self._context.executor
@executor.setter def executor(self, value: futures.Executor | None) -> None: # pragma: no cover """ Change the executor.
:param value: the new executor or ``None`` :type value: futures.Executor | None
""" self._context.executor = value
@property def loop(self) -> asyncio.AbstractEventLoop | None: """::return: the event loop.""" return self._context.loop
async def acquire( # type: ignore[override] self, timeout: float | None = None, poll_interval: float = 0.05, *, blocking: bool | None = None, ) -> AsyncAcquireReturnProxy: """ Try to acquire the file lock.
:param timeout: maximum wait time for acquiring the lock, ``None`` means use the default :attr:`~BaseFileLock.timeout` is and if ``timeout < 0``, there is no timeout and this method will block until the lock could be acquired :param poll_interval: interval of trying to acquire the lock file :param blocking: defaults to True. If False, function will return immediately if it cannot obtain a lock on the first attempt. Otherwise, this method will block until the timeout expires or the lock is acquired. :raises Timeout: if fails to acquire lock within the timeout period :return: a context object that will unlock the file when the context is exited
.. code-block:: python
# You can use this method in the context manager (recommended) with lock.acquire(): pass
# Or use an equivalent try-finally construct: lock.acquire() try: pass finally: lock.release()
""" # Use the default timeout, if no timeout is provided. if timeout is None: timeout = self._context.timeout
if blocking is None: blocking = self._context.blocking
# Increment the number right at the beginning. We can still undo it, if something fails. self._context.lock_counter += 1
lock_id = id(self) lock_filename = self.lock_file start_time = time.perf_counter() try: while True: if not self.is_locked: _LOGGER.debug("Attempting to acquire lock %s on %s", lock_id, lock_filename) await self._run_internal_method(self._acquire) if self.is_locked: _LOGGER.debug("Lock %s acquired on %s", lock_id, lock_filename) break if blocking is False: _LOGGER.debug("Failed to immediately acquire lock %s on %s", lock_id, lock_filename) raise Timeout(lock_filename) # noqa: TRY301 if 0 <= timeout < time.perf_counter() - start_time: _LOGGER.debug("Timeout on acquiring lock %s on %s", lock_id, lock_filename) raise Timeout(lock_filename) # noqa: TRY301 msg = "Lock %s not acquired on %s, waiting %s seconds ..." _LOGGER.debug(msg, lock_id, lock_filename, poll_interval) await asyncio.sleep(poll_interval) except BaseException: # Something did go wrong, so decrement the counter. self._context.lock_counter = max(0, self._context.lock_counter - 1) raise return AsyncAcquireReturnProxy(lock=self)
async def release(self, force: bool = False) -> None: # type: ignore[override] # noqa: FBT001, FBT002 """ Releases the file lock. Please note, that the lock is only completely released, if the lock counter is 0. Also note, that the lock file itself is not automatically deleted.
:param force: If true, the lock counter is ignored and the lock is released in every case/
""" if self.is_locked: self._context.lock_counter -= 1
if self._context.lock_counter == 0 or force: lock_id, lock_filename = id(self), self.lock_file
_LOGGER.debug("Attempting to release lock %s on %s", lock_id, lock_filename) await self._run_internal_method(self._release) self._context.lock_counter = 0 _LOGGER.debug("Lock %s released on %s", lock_id, lock_filename)
async def _run_internal_method(self, method: Callable[[], Any]) -> None: if asyncio.iscoroutinefunction(method): await method() elif self.run_in_executor: loop = self.loop or asyncio.get_running_loop() await loop.run_in_executor(self.executor, method) else: method()
def __enter__(self) -> NoReturn: """ Replace old __enter__ method to avoid using it.
NOTE: DO NOT USE `with` FOR ASYNCIO LOCKS, USE `async with` INSTEAD.
:return: none :rtype: NoReturn """ msg = "Do not use `with` for asyncio locks, use `async with` instead." raise NotImplementedError(msg)
async def __aenter__(self) -> Self: """ Acquire the lock.
:return: the lock object
""" await self.acquire() return self
async def __aexit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, ) -> None: """ Release the lock.
:param exc_type: the exception type if raised :param exc_value: the exception value if raised :param traceback: the exception traceback if raised
""" await self.release()
def __del__(self) -> None: """Called when the lock object is deleted.""" with contextlib.suppress(RuntimeError): loop = self.loop or asyncio.get_running_loop() if not loop.is_running(): # pragma: no cover loop.run_until_complete(self.release(force=True)) else: loop.create_task(self.release(force=True))
class AsyncSoftFileLock(SoftFileLock, BaseAsyncFileLock): """Simply watches the existence of the lock file."""
class AsyncUnixFileLock(UnixFileLock, BaseAsyncFileLock): """Uses the :func:`fcntl.flock` to hard lock the lock file on unix systems."""
class AsyncWindowsFileLock(WindowsFileLock, BaseAsyncFileLock): """Uses the :func:`msvcrt.locking` to hard lock the lock file on windows systems."""
__all__ = [ "AsyncAcquireReturnProxy", "AsyncSoftFileLock", "AsyncUnixFileLock", "AsyncWindowsFileLock", "BaseAsyncFileLock",]123456789101112131415161718192021# file generated by setuptools-scm# don't change, don't track in version control
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
TYPE_CHECKING = Falseif TYPE_CHECKING: from typing import Tuple from typing import Union
VERSION_TUPLE = Tuple[Union[int, str], ...]else: VERSION_TUPLE = object
version: str__version__: str__version_tuple__: VERSION_TUPLEversion_tuple: VERSION_TUPLE
__version__ = version = '3.18.0'__version_tuple__ = version_tuple = (3, 18, 0).gitattributes+249
bin/deepspeed.ptAdded+3
bin/ninjaAdded+3
lib/python3.12/site-packages/IPython/core/__pycache__/completer.cpython-312.pycAdded+3
lib/python3.12/site-packages/IPython/core/__pycache__/interactiveshell.cpython-312.pycAdded+3
lib/python3.12/site-packages/_yaml/__init__.pyAdded+33
lib/python3.12/site-packages/_yaml/__pycache__/__init__.cpython-312.pycAdded
lib/python3.12/site-packages/absl/testing/__pycache__/absltest.cpython-312.pycAdded+3
lib/python3.12/site-packages/attr/__pycache__/_make.cpython-312.pycAdded+3
lib/python3.12/site-packages/certifi-2026.1.4.dist-info/INSTALLERAdded+1
lib/python3.12/site-packages/certifi-2026.1.4.dist-info/METADATAAdded+78
lib/python3.12/site-packages/certifi-2026.1.4.dist-info/RECORDAdded+14
lib/python3.12/site-packages/certifi-2026.1.4.dist-info/WHEELAdded+5
lib/python3.12/site-packages/certifi-2026.1.4.dist-info/licenses/LICENSEAdded+20
lib/python3.12/site-packages/certifi-2026.1.4.dist-info/top_level.txtAdded+1
lib/python3.12/site-packages/cusparselt/lib/libcusparseLt.so.0Added+3
lib/python3.12/site-packages/datasets/__pycache__/arrow_dataset.cpython-312.pycAdded+3
lib/python3.12/site-packages/datasets/__pycache__/dataset_dict.cpython-312.pycAdded+3
lib/python3.12/site-packages/datasets/__pycache__/iterable_dataset.cpython-312.pycAdded+3
lib/python3.12/site-packages/datasets/__pycache__/table.cpython-312.pycAdded+3
lib/python3.12/site-packages/datasets/features/__pycache__/features.cpython-312.pycAdded+3
lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/INSTALLERAdded+1
lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/METADATAAdded+443
lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/RECORDAdded
lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/REQUESTEDAdded
lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/WHEELAdded+5
lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/entry_points.txtAdded+2
lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/licenses/LICENSEAdded+201
lib/python3.12/site-packages/deepspeed-0.17.0.dist-info/top_level.txtAdded+1
lib/python3.12/site-packages/deepspeed/nebula/__pycache__/__init__.cpython-312.pycAdded
lib/python3.12/site-packages/distutils-precedence.pthAdded+3
lib/python3.12/site-packages/filelock/__init__.pyAdded+70
lib/python3.12/site-packages/filelock/__pycache__/__init__.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/__pycache__/_api.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/__pycache__/_error.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/__pycache__/_soft.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/__pycache__/_unix.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/__pycache__/_util.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/__pycache__/_windows.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/__pycache__/asyncio.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/__pycache__/version.cpython-312.pycAdded
lib/python3.12/site-packages/filelock/_api.pyAdded+403
lib/python3.12/site-packages/filelock/_error.pyAdded+30
lib/python3.12/site-packages/filelock/_soft.pyAdded+47
lib/python3.12/site-packages/filelock/_unix.pyAdded+70
lib/python3.12/site-packages/filelock/_util.pyAdded+52
lib/python3.12/site-packages/filelock/_windows.pyAdded+65
lib/python3.12/site-packages/filelock/asyncio.pyAdded+342
lib/python3.12/site-packages/filelock/py.typedAdded
lib/python3.12/site-packages/filelock/version.pyAdded+21