Skip to content

Commit 1c609b2

Browse files
ITEP-67981 - Enable XPU support (#458)
1 parent 1ebbd3f commit 1c609b2

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

.github/components-path-filters.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -277,19 +277,19 @@ interactive_ai/workflows/geti_domain/train:
277277
- Makefile.shared-python
278278
- Makefile.shared
279279
- .github/workflows/component.yml
280-
interactive_ai/workflows/otx_domain/trainer/otx_v2/xpu:
281-
- interactive_ai/workflows/otx_domain/trainer/otx_v2/xpu/**
282-
- interactive_ai/workflows/otx_domain/trainer/otx_v2/scripts/**
283-
- interactive_ai/workflows/otx_domain/trainer/otx_v2/tests/**
284-
- interactive_ai/workflows/otx_domain/trainer/otx_v2/download_pretrained_weights.py
285-
- interactive_ai/workflows/otx_domain/trainer/otx_v2/pyproject.toml
286-
- interactive_ai/workflows/otx_domain/trainer/otx_v2/run
287-
- libs/telemetry_tools/**
288-
- libs/kafka_tools/**
289-
- Makefile.shared-python
290-
- Makefile.shared
291-
- .github/workflows/component.yml
292280
# TODO: Re-enable CVS-166868
281+
#interactive_ai/workflows/otx_domain/trainer/otx_v2/xpu:
282+
# - interactive_ai/workflows/otx_domain/trainer/otx_v2/xpu/**
283+
# - interactive_ai/workflows/otx_domain/trainer/otx_v2/scripts/**
284+
# - interactive_ai/workflows/otx_domain/trainer/otx_v2/tests/**
285+
# - interactive_ai/workflows/otx_domain/trainer/otx_v2/download_pretrained_weights.py
286+
# - interactive_ai/workflows/otx_domain/trainer/otx_v2/pyproject.toml
287+
# - interactive_ai/workflows/otx_domain/trainer/otx_v2/run
288+
# - libs/telemetry_tools/**
289+
# - libs/kafka_tools/**
290+
# - Makefile.shared-python
291+
# - Makefile.shared
292+
# - .github/workflows/component.yml
293293
# interactive_ai/workflows/otx_domain/trainer/otx_v2/gpu:
294294
# - interactive_ai/workflows/otx_domain/trainer/otx_v2/gpu/**
295295
# - interactive_ai/workflows/otx_domain/trainer/otx_v2/scripts/**

interactive_ai/workflows/otx_domain/trainer/otx_v2/gpu/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ test-unit: venv
3131
-PYTHONPATH=../scripts uv run pytest ../tests --disable-warnings -v
3232
true
3333

34-
test-component: venv
34+
test-component:
3535
@echo "test-component not available"
3636

37-
test-integration: venv
37+
test-integration:
3838
@echo "test-integration not available"

interactive_ai/workflows/otx_domain/trainer/otx_v2/xpu/Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Required runtime flags to enable XPU support:
2+
# --device /dev/dri # Intel GPU access
3+
# -v /dev/dri/by-path:/dev/dri/by-path # Device path mapping
4+
15
FROM python:3.10-slim-bookworm@sha256:99d6b199420e2a3588649813218bef3e727fac9642d5da66c1c24ec96f7ec87d AS base
26

37
ENV UV_COMPILE_BYTECODE=1
@@ -43,15 +47,14 @@ COPY --link --from=ghcr.io/astral-sh/uv:0.6.12@sha256:515b886e8eb99bcf9278776d8e
4347

4448
COPY --link scripts/ scripts
4549
COPY --link run run
50+
COPY --link uv.lock uv.lock
51+
COPY --link pyproject.toml pyproject.toml
4652
COPY --link download_pretrained_weights.py download_pretrained_weights.py
4753

4854
# For OTX to install torch with ipex support, else defaults to cpu version
49-
ENV PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/xpu
50-
51-
RUN --mount=type=cache,target=/root/.cache/uv \
52-
--mount=type=bind,source=uv.lock,target=uv.lock \
53-
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
54-
uv sync --frozen --no-dev --no-editable
55+
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev --no-editable
56+
RUN uv pip uninstall torch
57+
RUN uv pip install torch==2.7.0 --default-index https://download.pytorch.org/whl/xpu
5558

5659
# step 3: build final runtime image
5760
FROM base AS runtime
@@ -65,5 +68,6 @@ ENV PYTHONPATH="/interactive_ai/workflows/otx_domain/trainer/otx_v2"
6568
ENV HF_HUB_OFFLINE=1
6669

6770
USER non-root
71+
6872
WORKDIR /home/non-root
69-
WORKDIR /interactive_ai/workflows/otx_domain/trainer/otx_v2
73+
WORKDIR /interactive_ai/workflows/otx_domain/trainer/otx_v2

interactive_ai/workflows/otx_domain/trainer/otx_v2/xpu/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ test-unit: venv
3131
-PYTHONPATH=../scripts uv run pytest ../tests --disable-warnings -v
3232
true
3333

34-
test-component: venv
34+
test-component:
3535
@echo "test-component not available"
3636

37-
test-integration: venv
37+
test-integration:
3838
@echo "test-integration not available"

0 commit comments

Comments
 (0)