Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
name: pytorch
needs:
- prepare
- cann
# - cann
if: |
!cancelled() &&
contains(needs.prepare.outputs.targets, 'pytorch') &&
Expand Down
16 changes: 8 additions & 8 deletions arg.json
Original file line number Diff line number Diff line change
Expand Up @@ -379,24 +379,24 @@
],
"pytorch": [
{
"pytorch_version": "2.1.0",
"cann_tag": "8.0.rc1-910b-ubuntu22.04-py3.8",
"pytorch_version": "2.6.0",
"cann_tag": "8.2.rc1-910b-ubuntu22.04-py3.11",
"tags": {
"common": [
"2.1.0",
"ubuntu-python3.8-cann8.0.rc1-pytorch2.1.0"
"2.6.0",
"ubuntu-python3.11-cann8.2.rc1-pytorch2.6.0"
],
"ascendhub": [
]
}
},
{
"pytorch_version": "2.2.0",
"cann_tag": "8.0.rc1-910b-ubuntu22.04-py3.8",
"pytorch_version": "2.7.1",
"cann_tag": "8.2.rc1-910b-ubuntu22.04-py3.11",
"tags": {
"common": [
"2.2.0",
"ubuntu-python3.8-cann8.0.rc1-pytorch2.2.0"
"2.7.1",
"ubuntu-python3.11-cann8.2.rc1-pytorch2.7.1"
],
"ascendhub": [
]
Expand Down
18 changes: 9 additions & 9 deletions pytorch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
ARG BASE_VERSION=latest
FROM ascendai/cann:${BASE_VERSION} as official

Check warning on line 2 in pytorch/Dockerfile

View workflow job for this annotation

GitHub Actions / pytorch / build pytorch-2_7_1

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

Check warning on line 2 in pytorch/Dockerfile

View workflow job for this annotation

GitHub Actions / pytorch / build pytorch-2_6_0

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

# Arguments
ARG PYTORCH_VERSION=2.2.0
ARG PYTORCH_VERSION=2.7.1

# Change the default shell
SHELL [ "/bin/bash", "-c" ]

# Install pytorch, torch-npu and related packages
RUN if [ "${PYTORCH_VERSION}" == "2.1.0" ]; then \
TORCH_VISION_VERSION=0.16.0; \
TORCH_AUDIO_VERSION=2.1.0; \
TORCH_NPU_VERSION=2.1.0; \
elif [ "${PYTORCH_VERSION}" == "2.2.0" ]; then \
TORCH_VISION_VERSION=0.17.0; \
TORCH_AUDIO_VERSION=2.2.0; \
TORCH_NPU_VERSION=2.2.0; \
RUN if [ "${PYTORCH_VERSION}" == "2.6.0" ]; then \
TORCH_VISION_VERSION=0.21.0; \
TORCH_AUDIO_VERSION=2.6.0; \
TORCH_NPU_VERSION=2.6.0; \
elif [ "${PYTORCH_VERSION}" == "2.7.1" ]; then \
TORCH_VISION_VERSION=0.22.1; \
TORCH_AUDIO_VERSION=2.7.1; \
TORCH_NPU_VERSION=2.7.1rc1; \
else \
echo "Not supported version: ${PYTORCH_VERSION}."; \
exit 1; \
Expand Down
8 changes: 4 additions & 4 deletions pytorch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ The pytorch image is based on the [cann](../cann) image. These packages are inst

Here are available tags and the build args can be found at [arg.json](../arg.json).

- `2.1.0`
- `2.2.0`
- `2.6.0`
- `2.7.1`

> [!NOTE]
>
Expand All @@ -36,7 +36,7 @@ docker run \
-v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \
-v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-it ascendai/pytorch:2.2.0 bash
-it ascendai/pytorch:2.7.1 bash
```

## Build
Expand All @@ -56,6 +56,6 @@ docker build \
-t ascendai/pytorch:latest \
-f pytorch/new.Dockerfile \
--build-arg BASE_VERSION=latest \
--build-arg PYTORCH_VERSION=2.2.0 \
--build-arg PYTORCH_VERSION=2.7.1 \
pytorch/
```
Loading