diff --git a/recipes/tensorizer/recipe.yaml b/recipes/tensorizer/recipe.yaml new file mode 100644 index 0000000000000..034a0a79756d0 --- /dev/null +++ b/recipes/tensorizer/recipe.yaml @@ -0,0 +1,103 @@ +context: + version: 2.9.1 + +package: + name: tensorizer + version: ${{ version }} + +source: +- url: https://pypi.org/packages/source/t/tensorizer/tensorizer-${{ version }}.tar.gz + sha256: f79ac50d0a3bc328e3ee8cdf838ba04ddb5b9fa1d72be69f6ae618533d349e8e + +build: + noarch: python + number: 0 + script: ${{ PYTHON }} -m pip install . + +requirements: + host: + - python ${{ python_min }}.* + - setuptools + - pip + run: + - python >=${{ python_min }} + - pytorch >=1.9.0 + - numpy >=1.19.5 + - protobuf >=3.19.5 + - psutil >=5.9.4 + - boto3 >=1.26.0 + - redis-py >=4.5.5 + - hiredis >=2.2.0 + - libnacl-python-bindings >=2.1.0 + +tests: +- python: + imports: + - tensorizer + pip_check: true + python_version: ${{ python_min }}.* +- files: + source: + - tests/ + requirements: + run: + - pytest + - pytest-rerunfailures + - transformers >=4.27.1 + - moto >=4.1.4,<5.0.0 + - redis-py >=5.0.0 + - if: not win + then: + - redis-server + - boto3 + # Opened + # to fix the underlying issue. + - numpy <2 + script: + # Redis tests are flaky, sometimes failing with: + # redis.exceptions.ConnectionError: Error 111 connecting to localhost:6381. + # Connection refused. + # I suspect that there's not enough startup time, so we retry a few times. + - if: linux + then: + - pytest tests -vvv --reruns 2 + # Fails on macOS and Windows in test_cpu_multiple_readers + # (test_serialization.TestDeserialization) with: + # ValueError: Cannot reopen this type of file to enable parallel reading with + # num_readers > 1. File paths, URIs, and HTTP(S) or S3 streams returned from + # tensorizer.stream_io.open_stream, plus some open files are capable of being + # reopened. Other file-like objects and special files (e.g. BytesIO, pipes, + # sockets) are not supported. + # Unfortunately I don't know which type of file is being opened, but this doesn't + # seem serious, so I'm skipping it. + - if: osx + then: + - | + pytest tests -vvv --reruns 2 \ + --deselect tests/test_serialization.py::TestDeserialization::test_cpu_multiple_readers + # In addition to the above, we don't have a Redis server on Windows. + # Also, test_bfloat16 and test_structure fail with: + # PermissionError: [WinError 32] The process cannot access the file because it + # is being used by another process: + # 'C:\\Users\\VSSADM~1\\AppData\\Local\\Temp\\tensorizer-testu78j78id' + - if: win + then: + - | + pytest tests -vvv ^ + --deselect tests/test_serialization.py::TestDeserialization::test_cpu_multiple_readers ^ + --deselect tests/test_serialization.py::TestDeserialization::test_redis ^ + --deselect tests/test_stream_io.py::TestRedis::test_redis_stream ^ + --deselect tests/test_serialization.py::TestSerialization::test_bfloat16 ^ + --deselect tests/test_serialization.py::TestSerialization::test_structure + +about: + homepage: https://github.com/coreweave/tensorizer + repository: https://github.com/coreweave/tensorizer + summary: A tool for fast PyTorch module, model, and tensor serialization + deserialization. + description: Module, Model, and Tensor Serialization/Deserialization + license: MIT + license_file: LICENSE + +extra: + recipe-maintainers: + - maresb