This commit is contained in:
Nicolas Patry 2024-10-02 17:57:23 +02:00
parent cbc7d09da6
commit 7bead9ef0f
No known key found for this signature in database
GPG Key ID: E939E8CC91A1C674
2 changed files with 18 additions and 10 deletions

View File

@ -197,5 +197,7 @@ jobs:
# export EXTRA_PYTEST="${{ needs.build-and-push.outputs.extra_pytest }}"
# export HF_TOKEN=${{ secrets.HF_TOKEN }}
echo $DOCKER_IMAGE
python -c 'import docker; client = docker.from_env(); client.containers.run("registry.internal.huggingface.tech/api-inference/community/text-generation-inference:sha-318bbc7-rocm", devices=["/dev/kfd", "/dev/dri"])'
# python -c 'import docker; client = docker.from_env(); client.containers.run("registry.internal.huggingface.tech/api-inference/community/text-generation-inference:sha-318bbc7-rocm", devices=["/dev/kfd", "/dev/dri"], env={"MODEL_ID": "gpt2"}, detach=True)'
which pytest
pytest -s -vv integration-tests -k flash_llama_grammar_tools
# pytest -s -vv integration-tests ${PYTEST_FLAGS} ${EXTRA_PYTEST}

View File

@ -507,9 +507,9 @@ def launcher(event_loop):
if DOCKER_DEVICES:
devices = DOCKER_DEVICES.split(",")
# visible = os.getenv("ROCR_VISIBLE_DEVICES")
# if visible:
# env["ROCR_VISIBLE_DEVICES"] = visible
visible = os.getenv("ROCR_VISIBLE_DEVICES")
if visible:
env["ROCR_VISIBLE_DEVICES"] = visible
device_requests = []
else:
devices = []
@ -517,18 +517,24 @@ def launcher(event_loop):
docker.types.DeviceRequest(count=gpu_count, capabilities=[["gpu"]])
]
print("Starting docker")
args = ["sleep", "infinity"]
raise Exception(
f"""
Docoker image: {DOCKER_IMAGE}
args: {args}
container name: {container_name}
env: {env}
device_requests: {device_requests}
devices: {devices}
"""
)
container = client.containers.run(
DOCKER_IMAGE,
command=args,
# name=container_name,
name=container_name,
environment=env,
auto_remove=False,
detach=True,
# device_requests=device_requests,
device_requests=device_requests,
devices=devices,
volumes=volumes,
ports={"80/tcp": port},