Skip to content

Commit 351ba94

Browse files
committed
smoke test poetry
Add a little more tests test Test poetry test Test poetry on python 3.10 Add more poetry tests Test en us test test Try verboose testing testing try quiet install Code refactooring test move linux pipy validation to workflow test test Fix path try test pipy More torch installations test testing test test test new fix install 2 try poetry nightly test nightly test test Test poetry validation test test_new test Put back executing this on pull Print matrix variable test Fix conditional for pypi poetry tests add quptes Add nightly as supplemental requirement Make sure we clone module only for first time Fix python test validate binaries Add repo existance checks test Disable runtime error before final validation fix typo fix cwd
1 parent 5b310b4 commit 351ba94

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

.github/scripts/validate_poetry.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ if [[ ${MATRIX_CHANNEL} != "release" ]]; then
1212
# Installing poetry from our custom repo. We need to configure it before use and disable authentication
1313
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
1414
poetry source add --priority=explicit domains "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}"
15-
poetry source add --priority=explicit pytorch "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}_pypi_cudnn"
15+
poetry source add --priority=supplemental pytorch-nightly "https://download.pytorch.org/whl/${MATRIX_CHANNEL}"
16+
poetry source add --priority=supplemental pytorch "https://download.pytorch.org/whl/${MATRIX_CHANNEL}/${MATRIX_DESIRED_CUDA}_pypi_cudnn"
1617
poetry --quiet add --source pytorch torch
1718
poetry --quiet add --source domains torchvision torchaudio
1819
else

.github/workflows/validate-linux-binaries.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ jobs:
5858
5959
# Special case PyPi installation package. And Install of PyPi package via poetry
6060
if [[ ${MATRIX_PACKAGE_TYPE} == "manywheel" ]] && \
61-
{[${MATRIX_GPU_ARCH_VERSION} == "12.1" && ${MATRIX_CHANNEL} != "release"] || \
62-
[${MATRIX_GPU_ARCH_VERSION} == "11.7" && ${MATRIX_CHANNEL} == "release"]}; then
63-
source ./.github/scripts/validate_pipy.sh
64-
source ./.github/scripts/validate_poetry.sh
61+
([[ ${MATRIX_GPU_ARCH_VERSION} == "12.1" && ${MATRIX_CHANNEL} != "release" ]] || \
62+
[[ ${MATRIX_GPU_ARCH_VERSION} == "11.7" && ${MATRIX_CHANNEL} == "release" ]]); then
63+
source ./.github/scripts/validate_pipy.sh --runtime-error-check disabled
64+
source ./.github/scripts/validate_poetry.sh --runtime-error-check disabled
6565
fi
6666
67+
# Standart case: Validate binaries
6768
source ./.github/scripts/validate_binaries.sh

test/smoke_test/smoke_test.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package_type = os.getenv("MATRIX_PACKAGE_TYPE")
1919

2020
is_cuda_system = gpu_arch_type == "cuda"
21-
SCRIPT_DIR = Path(__file__).parent
2221
NIGHTLY_ALLOWED_DELTA = 3
2322

2423
MODULES = [
@@ -27,12 +26,14 @@
2726
"repo": "https://github.com/pytorch/vision.git",
2827
"smoke_test": "python ./vision/test/smoke_test.py",
2928
"extension": "extension",
29+
"repo_name": "vision",
3030
},
3131
{
3232
"name": "torchaudio",
3333
"repo": "https://github.com/pytorch/audio.git",
3434
"smoke_test": "python ./audio/test/smoke_test/smoke_test.py --no-ffmpeg",
3535
"extension": "_extension",
36+
"repo_name": "audio",
3637
},
3738
]
3839

@@ -100,7 +101,7 @@ def test_cuda_runtime_errors_captured() -> None:
100101
if(cuda_exception_missed):
101102
raise RuntimeError( f"Expected CUDA RuntimeError but have not received!")
102103

103-
def smoke_test_cuda(package: str) -> None:
104+
def smoke_test_cuda(package: str, runtime_error_check: str) -> None:
104105
if not torch.cuda.is_available() and is_cuda_system:
105106
raise RuntimeError(f"Expected CUDA {gpu_arch_ver}. However CUDA is not loaded.")
106107

@@ -130,7 +131,8 @@ def smoke_test_cuda(package: str) -> None:
130131
if (sys.platform == "linux" or sys.platform == "linux2") and sys.version_info < (3, 11, 0):
131132
smoke_test_compile()
132133

133-
test_cuda_runtime_errors_captured()
134+
if(runtime_error_check == "enabled"):
135+
test_cuda_runtime_errors_captured()
134136

135137

136138
def smoke_test_conv2d() -> None:
@@ -203,9 +205,12 @@ def foo(x: torch.Tensor) -> torch.Tensor:
203205
x_pt2 = torch.compile(model, mode="max-autotune")(x)
204206

205207
def smoke_test_modules():
208+
cwd = os.getcwd()
206209
for module in MODULES:
207210
if module["repo"]:
208-
subprocess.check_output(f"git clone --depth 1 {module['repo']}", stderr=subprocess.STDOUT, shell=True)
211+
if not os.path.exists(f"{cwd}/{module['repo_name']}"):
212+
print(f"Path does not exist: {cwd}/{module['repo_name']}")
213+
subprocess.check_output(f"git clone --depth 1 {module['repo']}", stderr=subprocess.STDOUT, shell=True)
209214
try:
210215
output = subprocess.check_output(
211216
module["smoke_test"], stderr=subprocess.STDOUT, shell=True,
@@ -227,6 +232,13 @@ def main() -> None:
227232
choices=["all", "torchonly"],
228233
default="all",
229234
)
235+
parser.add_argument(
236+
"--runtime-error-check",
237+
help="No Runtime Error check",
238+
type=str,
239+
choices=["enabled", "disabled"],
240+
default="enabled",
241+
)
230242
options = parser.parse_args()
231243
print(f"torch: {torch.__version__}")
232244
check_version(options.package)
@@ -236,7 +248,7 @@ def main() -> None:
236248
if options.package == "all":
237249
smoke_test_modules()
238250

239-
smoke_test_cuda(options.package)
251+
smoke_test_cuda(options.package, options.runtime_error_check)
240252

241253

242254
if __name__ == "__main__":

0 commit comments

Comments
 (0)