Skip to content

Commit 1b2c560

Browse files
authored
[CI] Refactor workflows (#2)
1 parent ec4e06c commit 1b2c560

File tree

6 files changed

+125
-82
lines changed

6 files changed

+125
-82
lines changed

.github/workflows/_build-and-test.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Test
1+
name: '[Internal] Build and Test'
22

33
on:
44
workflow_call:
@@ -7,14 +7,14 @@ on:
77
required: true
88
type: string
99
description: The runner selected to run on
10-
devices:
10+
device:
1111
required: true
1212
type: string
13-
description: The devices selected to run on
13+
description: The device selected to run on
1414
image:
1515
required: true
1616
type: string
17-
description: The docker iamge which will be loaded
17+
description: The docker image which will be loaded
1818

1919
jobs:
2020
build-and-test:
@@ -32,7 +32,12 @@ jobs:
3232
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
3333
- /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info
3434
- /home/runner/actions-runner/codes:/root/codes
35-
options: --network host ${{ inputs.devices }} --device /dev/davinci_manager --device /dev/devmm_svm --device /dev/hisi_hdc
35+
options: >-
36+
--network host
37+
--device ${{ inputs.device }}
38+
--device /dev/davinci_manager
39+
--device /dev/devmm_svm
40+
--device /dev/hisi_hdc
3641
steps:
3742
#- name: Set environment
3843
# run: |

.github/workflows/_fetch_and_rebase.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Fetch and Rebase
1+
name: '[Internal] Fetch and Rebase'
22

33
on:
44
workflow_call:
@@ -23,7 +23,7 @@ jobs:
2323
# remote_branch: upstream/main
2424
# loop: ${{ inputs.loop }}
2525
- name: Pull latest codes for torch_npu
26-
uses: cosdt/pytorch-integration-tests/.github/actions/fetch-and-rebase@main
26+
uses: ./.github/actions/fetch-and-rebase
2727
with:
2828
repo_path: /home/runner/actions-runner/codes/npu/pytorch
2929
remote_branch: upstream/master

.github/workflows/ascend_npu_test.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Note:
2+
# Same runner only needs one job named like .*fetch-and-rebase
3+
4+
name: Ascend NPU Test Suite
5+
6+
on:
7+
push:
8+
branches:
9+
- 'main'
10+
paths:
11+
- '!**/*.md'
12+
13+
pull_request:
14+
branches:
15+
- 'main'
16+
paths:
17+
- '!**/*.md'
18+
19+
release:
20+
types:
21+
- 'published'
22+
23+
schedule:
24+
- cron: '0 12 * * *'
25+
26+
workflow_dispatch:
27+
inputs:
28+
runner:
29+
required: true
30+
type: choice
31+
options:
32+
- self-hosted
33+
default: 'self-hosted'
34+
description: The runner selected to run on
35+
device:
36+
required: true
37+
type: choice
38+
options:
39+
- /dev/davinci1
40+
- /dev/davinci2
41+
- /dev/davinci3
42+
- /dev/davinci4
43+
- /dev/davinci5
44+
- /dev/davinci6
45+
- /dev/davinci7
46+
- /dev/davinci8
47+
default: '/dev/davinci6'
48+
description: 'The device selected to run on'
49+
image:
50+
required: true
51+
type: choice
52+
options:
53+
- ascendai/cann:7.1-openeuler2203sp2
54+
default: 'ascendai/cann:7.1-openeuler2203sp2'
55+
description: The docker image which will be loaded
56+
57+
jobs:
58+
linux-py3_8-fetch-and-rebase:
59+
name: linux-py3_8-7.0.RC1.alpha005
60+
env:
61+
INPUT_RUNNER: ${{ github.event.inputs.runner || 'self-hosted' }}
62+
uses: ./.github/workflows/_fetch_and_rebase.yml
63+
with:
64+
runner: ${{ env.INPUT_RUNNER }}
65+
loop: 10
66+
67+
linux-py3_8-build-and-test:
68+
name: linux-py3_8-7.0.RC1.alpha005
69+
needs: linux-py3_8-fetch-and-rebase
70+
env:
71+
INPUT_RUNNER: ${{ github.event.inputs.runner || 'self-hosted' }}
72+
INPUT_DEVICE: ${{ github.event.inputs.device || '/dev/davinci6' }}
73+
INPUT_IMAGE: ${{ github.event.inputs.image || 'ascendai/cann:7.1-openeuler2203sp2' }}
74+
uses: ./.github/workflows/_build-and-test.yml
75+
with:
76+
runner: ${{ env.INPUT_RUNNER }}
77+
device: ${{ env.INPUT_DEVICE }}
78+
image: ${{ env.INPUT_IMAGE }}

.github/workflows/manual.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/periodic.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
# PyTorch Integration Tests
22

3-
Welcome to the `pytorch-integration-tests` repository! This repository is designed to facilitate the integration testing of different accelerators with PyTorch. Our primary focus is to ensure seamless integration and compatibility across various devices by running comprehensive GitHub workflows.
3+
Welcome to the `pytorch-integration-tests` repository! This repository is
4+
designed to facilitate the integration testing of different accelerators with
5+
PyTorch. Our primary focus is to ensure seamless integration and compatibility
6+
across various devices by running comprehensive GitHub workflows.
47

58
## Accelerator Integration Test Results
69

7-
|[torch_npu](https://github.com/ascend/pytorch)|
8-
|----|
9-
| ![torch_npu periodic workflow](https://github.com/cosdt/pytorch-integration-tests/actions/workflows/periodic.yml/badge.svg) |
10-
| ![torch_npu manual workflow](https://github.com/cosdt/pytorch-integration-tests/actions/workflows/manual.yml/badge.svg)| |
10+
| [torch_npu][1] |
11+
|----------------------------------------|
12+
| [![torch_npu periodic workflow][2]][3] |
13+
| [![torch_npu manual workflow][4]][5] |
1114

15+
[1]: https://github.com/ascend/pytorch
16+
17+
[2]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/periodic.yml/badge.svg
18+
19+
[3]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/periodic.yml
20+
21+
[4]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/manual.yml/badge.svg
22+
23+
[5]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/manual.yml
1224

1325
## Overview
1426

15-
This repository contains workflows and scripts that automate the testing process for integrating different hardware devices with PyTorch. The tests aim to validate that PyTorch's device-specific functionalities are working correctly and efficiently across different platforms.
27+
This repository contains workflows and scripts that automate the testing
28+
process for integrating different hardware devices with PyTorch. The tests aim
29+
to validate that PyTorch's device-specific functionalities are working
30+
correctly and efficiently across different platforms.
1631

1732
### Key Features
33+
1834
- **Automated Integration Tests**: Run tests automatically for different devices using GitHub Actions.
1935
- **Cross-Device Compatibility**: Ensure that PyTorch functions correctly on NPUs, GPUs, and other devices.
2036
- **Reusable Workflows**: Leverage modular and reusable workflows to streamline the testing process.
@@ -23,21 +39,28 @@ This repository contains workflows and scripts that automate the testing process
2339

2440
### Running Tests
2541

26-
To run the integration tests, the repository leverages GitHub Actions. You can trigger the tests by pushing code to the repository or by manually triggering the workflows.
42+
To run the integration tests, the repository leverages GitHub Actions.
43+
You can trigger the tests by pushing code to the repository or by manually
44+
triggering the workflows.
2745

2846
### Customizing Workflows
2947

30-
The workflows are designed to be flexible. You can customize the parameters such as the target branch, runner, and loop time by modifying the inputs in the workflow files.
48+
The workflows are designed to be flexible. You can customize the parameters
49+
such as the target branch, runner, and loop time by modifying the inputs in
50+
the workflow files.
3151

3252
## Contributing
3353

34-
We welcome contributions to enhance the integration testing process. Feel free to submit issues, pull requests, or suggestions to help us improve the compatibility and performance of PyTorch on various devices.
54+
We welcome contributions to enhance the integration testing process. Feel free
55+
to submit issues, pull requests, or suggestions to help us improve the
56+
compatibility and performance of PyTorch on various devices.
3557

3658
### Reporting Issues
3759

38-
If you encounter any issues while using the workflows or integrating a device, please report them via the [Issues](https://github.com/cosdt/pytorch-integration-tests/issues) tab.
60+
If you encounter any issues while using the workflows or integrating a device,
61+
please report them via the [Issues](https://github.com/cosdt/pytorch-integration-tests/issues) tab.
3962

4063
## License
4164

42-
This project is licensed under BSD-3-Clause license. See the [LICENSE](LICENSE) file for more details.
43-
65+
This project is licensed under BSD-3-Clause license. See the [LICENSE](LICENSE)
66+
file for more details.

0 commit comments

Comments
 (0)