From 7bd5c204d3e00e433a9748751034c8e06f22b8a7 Mon Sep 17 00:00:00 2001 From: yaofengchen <67218893+yao-fengchen@users.noreply.github.com> Date: Wed, 29 Nov 2023 17:22:10 +0800 Subject: [PATCH] [dicp][tops] Add dicp ci of tops. (#469) * Add dicp ci of tops. * Fix dicp ci of tops. --- .github/workflows/_runs-on-topsrider.yml | 30 +++++++++---------- dicp/dicp/vendor/__init__.py | 0 dicp/scripts/ci/tops/ci_tops_build_env.sh | 4 +++ dicp/scripts/ci/tops/ci_tops_test_env.sh | 6 ++++ dicp/test/__init__.py | 0 dicp/test/common/conftest.py | 2 +- dicp/test/model/conftest.py | 2 +- dicp/test/model/llama/generation.py | 4 +-- dicp/test/model/llama/model.py | 2 +- dicp/test/model/test_llama.py | 6 ++-- dicp/test/model/test_resnet50.py | 2 +- dicp/test/op/conftest.py | 2 +- dicp/test/op/test__adaptive_avg_pool2d.py | 2 +- .../op/test__adaptive_avg_pool2d_backward.py | 2 +- dicp/test/op/test__log_softmax.py | 2 +- ...est__native_batch_norm_legit_functional.py | 2 +- dicp/test/op/test__softmax.py | 2 +- dicp/test/op/test__unsafe_view.py | 2 +- dicp/test/op/test_abs.py | 2 +- dicp/test/op/test_add.py | 2 +- dicp/test/op/test_alias.py | 2 +- dicp/test/op/test_amax.py | 2 +- dicp/test/op/test_arange.py | 2 +- dicp/test/op/test_bernoulli.py | 2 +- dicp/test/op/test_bmm.py | 2 +- dicp/test/op/test_cat.py | 2 +- dicp/test/op/test_clone.py | 2 +- dicp/test/op/test_convert_element_type.py | 2 +- dicp/test/op/test_convolution.py | 2 +- dicp/test/op/test_convolution_backward.py | 2 +- dicp/test/op/test_copy.py | 2 +- dicp/test/op/test_copy_.py | 2 +- dicp/test/op/test_div.py | 2 +- dicp/test/op/test_embedding.py | 2 +- dicp/test/op/test_empty_like.py | 2 +- dicp/test/op/test_eq.py | 2 +- dicp/test/op/test_exp.py | 2 +- dicp/test/op/test_expand.py | 2 +- dicp/test/op/test_fill.py | 2 +- dicp/test/op/test_full.py | 2 +- dicp/test/op/test_full_like.py | 2 +- dicp/test/op/test_gather.py | 2 +- dicp/test/op/test_gelu.py | 2 +- dicp/test/op/test_gelu_backward.py | 2 +- dicp/test/op/test_getitem.py | 2 +- dicp/test/op/test_hardswish.py | 2 +- dicp/test/op/test_hardswish_backward.py | 2 +- dicp/test/op/test_index.py | 2 +- dicp/test/op/test_iota.py | 2 +- dicp/test/op/test_le.py | 2 +- dicp/test/op/test_lift_fresh_copy.py | 2 +- dicp/test/op/test_log.py | 2 +- dicp/test/op/test_lt.py | 2 +- dicp/test/op/test_masked_fill.py | 2 +- dicp/test/op/test_max_pool2d_with_indices.py | 2 +- .../test_max_pool2d_with_indices_backward.py | 2 +- dicp/test/op/test_maximum.py | 2 +- dicp/test/op/test_mean.py | 2 +- dicp/test/op/test_mm.py | 2 +- dicp/test/op/test_mul.py | 2 +- dicp/test/op/test_native_dropout.py | 2 +- dicp/test/op/test_ne.py | 2 +- dicp/test/op/test_neg.py | 2 +- dicp/test/op/test_new_empty_strided.py | 2 +- dicp/test/op/test_ones.py | 2 +- dicp/test/op/test_ones_like.py | 2 +- dicp/test/op/test_permute.py | 2 +- dicp/test/op/test_pow.py | 2 +- dicp/test/op/test_reciprocal.py | 2 +- dicp/test/op/test_relu.py | 2 +- dicp/test/op/test_repeat.py | 2 +- dicp/test/op/test_rsqrt.py | 2 +- dicp/test/op/test_scalar_tensor.py | 2 +- dicp/test/op/test_scatter.py | 2 +- dicp/test/op/test_select.py | 2 +- dicp/test/op/test_sigmoid.py | 2 +- dicp/test/op/test_slice.py | 2 +- dicp/test/op/test_slice_scatter.py | 2 +- dicp/test/op/test_softmax.py | 2 +- dicp/test/op/test_sqrt.py | 2 +- dicp/test/op/test_square.py | 2 +- dicp/test/op/test_squeeze.py | 2 +- dicp/test/op/test_sub.py | 2 +- dicp/test/op/test_sum.py | 2 +- dicp/test/op/test_transpose.py | 2 +- dicp/test/op/test_unsqueeze.py | 2 +- dicp/test/op/test_view.py | 2 +- dicp/test/op/test_view_as_complex.py | 2 +- dicp/test/op/test_view_as_real.py | 2 +- dicp/test/op/test_where.py | 2 +- dicp/test/op/test_zeros.py | 2 +- dicp/test/op/test_zeros_like.py | 2 +- 92 files changed, 114 insertions(+), 106 deletions(-) create mode 100644 dicp/dicp/vendor/__init__.py create mode 100644 dicp/scripts/ci/tops/ci_tops_build_env.sh create mode 100644 dicp/scripts/ci/tops/ci_tops_test_env.sh create mode 100644 dicp/test/__init__.py diff --git a/.github/workflows/_runs-on-topsrider.yml b/.github/workflows/_runs-on-topsrider.yml index ba0d99638..8427855c6 100644 --- a/.github/workflows/_runs-on-topsrider.yml +++ b/.github/workflows/_runs-on-topsrider.yml @@ -22,25 +22,23 @@ jobs: - name: Checkout Code uses: DeepLink-org/deeplink.framework/.github/actions/checkout-code@main - build: + build_test: runs-on: ${{ inputs.runner }} needs: checkout_code steps: - - name: build on topsrider + - name: build and test on topsrider uses: DeepLink-org/deeplink.framework/.github/actions/code-build-test@main with: - build_shell: "pwd" #Write the script you want to execute here,If you don't know which parameters to fill in, you can refer to the actions/code-build-test - job_name: "build" + build_shell: " + source dicp/scripts/ci/tops/ci_tops_build_env.sh && \ + pip uninstall torch_dipu -y && \ + pip uninstall dicp -y && \ + cd dipu && python setup.py install --user && \ + cd ../dicp && python setup.py install --user && \ + cd .. && source dicp/scripts/ci/tops/ci_tops_test_env.sh /mnt/models/llama_models && \ + export TEST_DIR=$(pwd)/dicp/test && echo ${TEST_DIR} && \ + bash ${TEST_DIR}/tops_scripts/ops/run_test_ops.sh false && \ + bash ${TEST_DIR}/tops_scripts/models/run_test_models.sh false + " + job_name: "build_test" cover_job: "0" - - test: - runs-on: ${{ inputs.runner }} - needs: build - steps: - - name: build on topsrider - uses: DeepLink-org/deeplink.framework/.github/actions/code-build-test@main - with: - build_shell: "pwd" #Write the script you want to execute here,If you don't know which parameters to fill in, you can refer to the actions/code-build-test - job_name: "build" - cover_job: "1" - diff --git a/dicp/dicp/vendor/__init__.py b/dicp/dicp/vendor/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/dicp/scripts/ci/tops/ci_tops_build_env.sh b/dicp/scripts/ci/tops/ci_tops_build_env.sh new file mode 100644 index 000000000..282d17849 --- /dev/null +++ b/dicp/scripts/ci/tops/ci_tops_build_env.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export DIPU_DEVICE=tops +export DIPU_WITH_DIOPI_LIBRARY=DISABLE diff --git a/dicp/scripts/ci/tops/ci_tops_test_env.sh b/dicp/scripts/ci/tops/ci_tops_test_env.sh new file mode 100644 index 000000000..77a5aaede --- /dev/null +++ b/dicp/scripts/ci/tops/ci_tops_test_env.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +LLAMA_MODEL_DIR=$1 + +export DIPU_MOCK_CUDA=false +export LLAMA_MODEL_DIR=$1 diff --git a/dicp/test/__init__.py b/dicp/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/dicp/test/common/conftest.py b/dicp/test/common/conftest.py index 3a15d5d06..3ce69c9c3 100644 --- a/dicp/test/common/conftest.py +++ b/dicp/test/common/conftest.py @@ -1,5 +1,5 @@ import pytest -from common.utils import parse_bool_arg +from ..common.utils import parse_bool_arg def pytest_addoption(parser): diff --git a/dicp/test/model/conftest.py b/dicp/test/model/conftest.py index 1b7605ce0..497970667 100644 --- a/dicp/test/model/conftest.py +++ b/dicp/test/model/conftest.py @@ -1 +1 @@ -from common.conftest import pytest_addoption, backend, dynamic # noqa F401 +from ..common.conftest import pytest_addoption, backend, dynamic # noqa F401 diff --git a/dicp/test/model/llama/generation.py b/dicp/test/model/llama/generation.py index ba280dd5d..5a2d4e127 100644 --- a/dicp/test/model/llama/generation.py +++ b/dicp/test/model/llama/generation.py @@ -1,8 +1,8 @@ from typing import List import torch -from model.llama.tokenizer import Tokenizer -from model.llama.model import Transformer, precompute_freqs_cis +from ...model.llama.tokenizer import Tokenizer +from ...model.llama.model import Transformer, precompute_freqs_cis class LLaMA: diff --git a/dicp/test/model/llama/model.py b/dicp/test/model/llama/model.py index d8bd4f152..05f24b118 100644 --- a/dicp/test/model/llama/model.py +++ b/dicp/test/model/llama/model.py @@ -4,7 +4,7 @@ import torch from torch import nn import torch.nn.functional as F -from common.utils import get_device +from ...common.utils import get_device device = get_device() diff --git a/dicp/test/model/test_llama.py b/dicp/test/model/test_llama.py index 3392b5583..0353b3aee 100644 --- a/dicp/test/model/test_llama.py +++ b/dicp/test/model/test_llama.py @@ -2,12 +2,12 @@ import torch import os import torch._dynamo as dynamo -from common import utils +from ..common import utils import torch_dipu import json from pathlib import Path -from model.llama.generation import Tokenizer, LLaMA -from model.llama.model import Transformer, ModelArgs +from ..model.llama.generation import Tokenizer, LLaMA +from ..model.llama.model import Transformer, ModelArgs dynamo.config.cache_size_limit = 128 utils.update_dynamo_config(False) device = utils.get_device() diff --git a/dicp/test/model/test_resnet50.py b/dicp/test/model/test_resnet50.py index 58f325cf1..774ec1ebb 100644 --- a/dicp/test/model/test_resnet50.py +++ b/dicp/test/model/test_resnet50.py @@ -5,7 +5,7 @@ import mmcls from mmcv import Config from mmcls.models import build_classifier -from common import utils +from ..common import utils import torch_dipu diff --git a/dicp/test/op/conftest.py b/dicp/test/op/conftest.py index 1b7605ce0..497970667 100644 --- a/dicp/test/op/conftest.py +++ b/dicp/test/op/conftest.py @@ -1 +1 @@ -from common.conftest import pytest_addoption, backend, dynamic # noqa F401 +from ..common.conftest import pytest_addoption, backend, dynamic # noqa F401 diff --git a/dicp/test/op/test__adaptive_avg_pool2d.py b/dicp/test/op/test__adaptive_avg_pool2d.py index 0055cb983..c933362be 100644 --- a/dicp/test/op/test__adaptive_avg_pool2d.py +++ b/dicp/test/op/test__adaptive_avg_pool2d.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test__adaptive_avg_pool2d_backward.py b/dicp/test/op/test__adaptive_avg_pool2d_backward.py index a1fe404b3..9f33eb360 100644 --- a/dicp/test/op/test__adaptive_avg_pool2d_backward.py +++ b/dicp/test/op/test__adaptive_avg_pool2d_backward.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test__log_softmax.py b/dicp/test/op/test__log_softmax.py index c16313ff2..9c05c8128 100644 --- a/dicp/test/op/test__log_softmax.py +++ b/dicp/test/op/test__log_softmax.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test__native_batch_norm_legit_functional.py b/dicp/test/op/test__native_batch_norm_legit_functional.py index 1e08e1dd0..68480bc47 100644 --- a/dicp/test/op/test__native_batch_norm_legit_functional.py +++ b/dicp/test/op/test__native_batch_norm_legit_functional.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test__softmax.py b/dicp/test/op/test__softmax.py index a158cd953..f9bd334a9 100644 --- a/dicp/test/op/test__softmax.py +++ b/dicp/test/op/test__softmax.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test__unsafe_view.py b/dicp/test/op/test__unsafe_view.py index fddde89c7..002259833 100644 --- a/dicp/test/op/test__unsafe_view.py +++ b/dicp/test/op/test__unsafe_view.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_abs.py b/dicp/test/op/test_abs.py index dd089d34a..4940e16f0 100644 --- a/dicp/test/op/test_abs.py +++ b/dicp/test/op/test_abs.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_add.py b/dicp/test/op/test_add.py index a5abeac78..c2df57e8b 100644 --- a/dicp/test/op/test_add.py +++ b/dicp/test/op/test_add.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_alias.py b/dicp/test/op/test_alias.py index aa54ee613..183c7f89b 100644 --- a/dicp/test/op/test_alias.py +++ b/dicp/test/op/test_alias.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_amax.py b/dicp/test/op/test_amax.py index 6a747ccab..2ec929951 100644 --- a/dicp/test/op/test_amax.py +++ b/dicp/test/op/test_amax.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_arange.py b/dicp/test/op/test_arange.py index bbade79fd..0f6dd2a66 100644 --- a/dicp/test/op/test_arange.py +++ b/dicp/test/op/test_arange.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_bernoulli.py b/dicp/test/op/test_bernoulli.py index 638066a38..3d7c0e8cc 100644 --- a/dicp/test/op/test_bernoulli.py +++ b/dicp/test/op/test_bernoulli.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, random, diff --git a/dicp/test/op/test_bmm.py b/dicp/test/op/test_bmm.py index c6060b074..966947111 100644 --- a/dicp/test/op/test_bmm.py +++ b/dicp/test/op/test_bmm.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_cat.py b/dicp/test/op/test_cat.py index d3729cdfb..dfde451af 100644 --- a/dicp/test/op/test_cat.py +++ b/dicp/test/op/test_cat.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_clone.py b/dicp/test/op/test_clone.py index 92875b9b8..2cdebfaa1 100644 --- a/dicp/test/op/test_clone.py +++ b/dicp/test/op/test_clone.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_convert_element_type.py b/dicp/test/op/test_convert_element_type.py index 08457a2bc..c61b46306 100644 --- a/dicp/test/op/test_convert_element_type.py +++ b/dicp/test/op/test_convert_element_type.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_convolution.py b/dicp/test/op/test_convolution.py index 6dbac31ee..6d2637efb 100644 --- a/dicp/test/op/test_convolution.py +++ b/dicp/test/op/test_convolution.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_convolution_backward.py b/dicp/test/op/test_convolution_backward.py index 9bdd5ffd1..4a8bd854b 100644 --- a/dicp/test/op/test_convolution_backward.py +++ b/dicp/test/op/test_convolution_backward.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_copy.py b/dicp/test/op/test_copy.py index 141e80e09..5a7495c57 100644 --- a/dicp/test/op/test_copy.py +++ b/dicp/test/op/test_copy.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_copy_.py b/dicp/test/op/test_copy_.py index 22e193eef..9bae81703 100644 --- a/dicp/test/op/test_copy_.py +++ b/dicp/test/op/test_copy_.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_div.py b/dicp/test/op/test_div.py index 1bcf97678..2afcf4045 100644 --- a/dicp/test/op/test_div.py +++ b/dicp/test/op/test_div.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_embedding.py b/dicp/test/op/test_embedding.py index 17424b0d2..e783a5eba 100644 --- a/dicp/test/op/test_embedding.py +++ b/dicp/test/op/test_embedding.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_empty_like.py b/dicp/test/op/test_empty_like.py index 793b8e835..83ac7134d 100644 --- a/dicp/test/op/test_empty_like.py +++ b/dicp/test/op/test_empty_like.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_eq.py b/dicp/test/op/test_eq.py index 595385719..96735ff2c 100644 --- a/dicp/test/op/test_eq.py +++ b/dicp/test/op/test_eq.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_exp.py b/dicp/test/op/test_exp.py index 19459e728..7be2d242a 100644 --- a/dicp/test/op/test_exp.py +++ b/dicp/test/op/test_exp.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_expand.py b/dicp/test/op/test_expand.py index 8c1fecde2..c112b4d6c 100644 --- a/dicp/test/op/test_expand.py +++ b/dicp/test/op/test_expand.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_fill.py b/dicp/test/op/test_fill.py index 4564aac05..a6d33656a 100644 --- a/dicp/test/op/test_fill.py +++ b/dicp/test/op/test_fill.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, random, diff --git a/dicp/test/op/test_full.py b/dicp/test/op/test_full.py index 46f06b25f..bdaa4f9df 100644 --- a/dicp/test/op/test_full.py +++ b/dicp/test/op/test_full.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, random, diff --git a/dicp/test/op/test_full_like.py b/dicp/test/op/test_full_like.py index 1af3f7917..449ee5747 100644 --- a/dicp/test/op/test_full_like.py +++ b/dicp/test/op/test_full_like.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, random, diff --git a/dicp/test/op/test_gather.py b/dicp/test/op/test_gather.py index 57dd389ba..9512a7ab3 100644 --- a/dicp/test/op/test_gather.py +++ b/dicp/test/op/test_gather.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_gelu.py b/dicp/test/op/test_gelu.py index 6d151fd60..68fb1f951 100644 --- a/dicp/test/op/test_gelu.py +++ b/dicp/test/op/test_gelu.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_gelu_backward.py b/dicp/test/op/test_gelu_backward.py index 62ca6981d..cff57d3d6 100644 --- a/dicp/test/op/test_gelu_backward.py +++ b/dicp/test/op/test_gelu_backward.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_getitem.py b/dicp/test/op/test_getitem.py index 536b84cd0..363d7a1b0 100644 --- a/dicp/test/op/test_getitem.py +++ b/dicp/test/op/test_getitem.py @@ -1,6 +1,6 @@ import pytest import operator -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_hardswish.py b/dicp/test/op/test_hardswish.py index 510207976..f9714ca49 100644 --- a/dicp/test/op/test_hardswish.py +++ b/dicp/test/op/test_hardswish.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_hardswish_backward.py b/dicp/test/op/test_hardswish_backward.py index 0caa23c4d..a40a1e018 100644 --- a/dicp/test/op/test_hardswish_backward.py +++ b/dicp/test/op/test_hardswish_backward.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_index.py b/dicp/test/op/test_index.py index ada427a0d..3b00ea749 100644 --- a/dicp/test/op/test_index.py +++ b/dicp/test/op/test_index.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_iota.py b/dicp/test/op/test_iota.py index 62b67845e..992845b76 100644 --- a/dicp/test/op/test_iota.py +++ b/dicp/test/op/test_iota.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_le.py b/dicp/test/op/test_le.py index 1d22872f2..13a266886 100644 --- a/dicp/test/op/test_le.py +++ b/dicp/test/op/test_le.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, random, diff --git a/dicp/test/op/test_lift_fresh_copy.py b/dicp/test/op/test_lift_fresh_copy.py index a938f9676..a785beafa 100644 --- a/dicp/test/op/test_lift_fresh_copy.py +++ b/dicp/test/op/test_lift_fresh_copy.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, random, diff --git a/dicp/test/op/test_log.py b/dicp/test/op/test_log.py index 3db038b83..a5e66ad0c 100644 --- a/dicp/test/op/test_log.py +++ b/dicp/test/op/test_log.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_lt.py b/dicp/test/op/test_lt.py index db9bc29ec..bbfb3c284 100644 --- a/dicp/test/op/test_lt.py +++ b/dicp/test/op/test_lt.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_masked_fill.py b/dicp/test/op/test_masked_fill.py index a73a4fd86..078574122 100644 --- a/dicp/test/op/test_masked_fill.py +++ b/dicp/test/op/test_masked_fill.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, random, diff --git a/dicp/test/op/test_max_pool2d_with_indices.py b/dicp/test/op/test_max_pool2d_with_indices.py index 427bf6752..9822054fa 100644 --- a/dicp/test/op/test_max_pool2d_with_indices.py +++ b/dicp/test/op/test_max_pool2d_with_indices.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_max_pool2d_with_indices_backward.py b/dicp/test/op/test_max_pool2d_with_indices_backward.py index 882d799be..0a1f9bbcc 100644 --- a/dicp/test/op/test_max_pool2d_with_indices_backward.py +++ b/dicp/test/op/test_max_pool2d_with_indices_backward.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_maximum.py b/dicp/test/op/test_maximum.py index 652cc47db..2123cabad 100644 --- a/dicp/test/op/test_maximum.py +++ b/dicp/test/op/test_maximum.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_mean.py b/dicp/test/op/test_mean.py index 0f3cf713c..288b3e128 100644 --- a/dicp/test/op/test_mean.py +++ b/dicp/test/op/test_mean.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_mm.py b/dicp/test/op/test_mm.py index 3d6236a3f..28047c090 100644 --- a/dicp/test/op/test_mm.py +++ b/dicp/test/op/test_mm.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_mul.py b/dicp/test/op/test_mul.py index 15a88da39..62ca9dd84 100644 --- a/dicp/test/op/test_mul.py +++ b/dicp/test/op/test_mul.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_native_dropout.py b/dicp/test/op/test_native_dropout.py index a34e8f4e2..0d8be2088 100644 --- a/dicp/test/op/test_native_dropout.py +++ b/dicp/test/op/test_native_dropout.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_ne.py b/dicp/test/op/test_ne.py index f3f30b049..81be6cc6f 100644 --- a/dicp/test/op/test_ne.py +++ b/dicp/test/op/test_ne.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, random, diff --git a/dicp/test/op/test_neg.py b/dicp/test/op/test_neg.py index 5dee45310..4e2e2a4a0 100644 --- a/dicp/test/op/test_neg.py +++ b/dicp/test/op/test_neg.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_new_empty_strided.py b/dicp/test/op/test_new_empty_strided.py index 4e38fc8c2..e6687b846 100644 --- a/dicp/test/op/test_new_empty_strided.py +++ b/dicp/test/op/test_new_empty_strided.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_ones.py b/dicp/test/op/test_ones.py index c1e726d0f..330669bd6 100644 --- a/dicp/test/op/test_ones.py +++ b/dicp/test/op/test_ones.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_ones_like.py b/dicp/test/op/test_ones_like.py index b4737be79..19f44108e 100644 --- a/dicp/test/op/test_ones_like.py +++ b/dicp/test/op/test_ones_like.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_permute.py b/dicp/test/op/test_permute.py index 36f74b915..998a457c0 100644 --- a/dicp/test/op/test_permute.py +++ b/dicp/test/op/test_permute.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_pow.py b/dicp/test/op/test_pow.py index 718bf3159..ad39090e7 100644 --- a/dicp/test/op/test_pow.py +++ b/dicp/test/op/test_pow.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_reciprocal.py b/dicp/test/op/test_reciprocal.py index f3f34d9d5..af237b9b7 100644 --- a/dicp/test/op/test_reciprocal.py +++ b/dicp/test/op/test_reciprocal.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_relu.py b/dicp/test/op/test_relu.py index 52107f7f1..943480059 100644 --- a/dicp/test/op/test_relu.py +++ b/dicp/test/op/test_relu.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_repeat.py b/dicp/test/op/test_repeat.py index 318797759..b1dc857ca 100644 --- a/dicp/test/op/test_repeat.py +++ b/dicp/test/op/test_repeat.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_rsqrt.py b/dicp/test/op/test_rsqrt.py index 8832b93ef..08fec133d 100644 --- a/dicp/test/op/test_rsqrt.py +++ b/dicp/test/op/test_rsqrt.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_scalar_tensor.py b/dicp/test/op/test_scalar_tensor.py index e1c4a1414..19668c5bd 100644 --- a/dicp/test/op/test_scalar_tensor.py +++ b/dicp/test/op/test_scalar_tensor.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_scatter.py b/dicp/test/op/test_scatter.py index 9f31803b8..45acf0273 100644 --- a/dicp/test/op/test_scatter.py +++ b/dicp/test/op/test_scatter.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_select.py b/dicp/test/op/test_select.py index af8e65c5d..c0b8513bc 100644 --- a/dicp/test/op/test_select.py +++ b/dicp/test/op/test_select.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_sigmoid.py b/dicp/test/op/test_sigmoid.py index a0de9e346..2dd11e381 100644 --- a/dicp/test/op/test_sigmoid.py +++ b/dicp/test/op/test_sigmoid.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_slice.py b/dicp/test/op/test_slice.py index c3f9e3f27..516487ca6 100644 --- a/dicp/test/op/test_slice.py +++ b/dicp/test/op/test_slice.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_slice_scatter.py b/dicp/test/op/test_slice_scatter.py index 509ae3b70..6cdb4fe79 100644 --- a/dicp/test/op/test_slice_scatter.py +++ b/dicp/test/op/test_slice_scatter.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_softmax.py b/dicp/test/op/test_softmax.py index b273d1374..7544e6448 100644 --- a/dicp/test/op/test_softmax.py +++ b/dicp/test/op/test_softmax.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_sqrt.py b/dicp/test/op/test_sqrt.py index c8e6931bd..0eb65ad24 100644 --- a/dicp/test/op/test_sqrt.py +++ b/dicp/test/op/test_sqrt.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_square.py b/dicp/test/op/test_square.py index 06111d250..cbdf8bb79 100644 --- a/dicp/test/op/test_square.py +++ b/dicp/test/op/test_square.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_squeeze.py b/dicp/test/op/test_squeeze.py index 376fdcc01..fdbc7e425 100644 --- a/dicp/test/op/test_squeeze.py +++ b/dicp/test/op/test_squeeze.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_sub.py b/dicp/test/op/test_sub.py index 78dd66b4b..f8f6a5a38 100644 --- a/dicp/test/op/test_sub.py +++ b/dicp/test/op/test_sub.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_sum.py b/dicp/test/op/test_sum.py index 4f4100af6..5707328fd 100644 --- a/dicp/test/op/test_sum.py +++ b/dicp/test/op/test_sum.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_transpose.py b/dicp/test/op/test_transpose.py index 0579e0389..48694c51d 100644 --- a/dicp/test/op/test_transpose.py +++ b/dicp/test/op/test_transpose.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_unsqueeze.py b/dicp/test/op/test_unsqueeze.py index 732d199ee..ee2f12302 100644 --- a/dicp/test/op/test_unsqueeze.py +++ b/dicp/test/op/test_unsqueeze.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_view.py b/dicp/test/op/test_view.py index 074d65499..e2e261dd0 100644 --- a/dicp/test/op/test_view.py +++ b/dicp/test/op/test_view.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_view_as_complex.py b/dicp/test/op/test_view_as_complex.py index ec0493190..62fb7c911 100644 --- a/dicp/test/op/test_view_as_complex.py +++ b/dicp/test/op/test_view_as_complex.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_view_as_real.py b/dicp/test/op/test_view_as_real.py index a352f3f49..e16f17dc8 100644 --- a/dicp/test/op/test_view_as_real.py +++ b/dicp/test/op/test_view_as_real.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_where.py b/dicp/test/op/test_where.py index 0099c5f1f..72f000ab5 100644 --- a/dicp/test/op/test_where.py +++ b/dicp/test/op/test_where.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_zeros.py b/dicp/test/op/test_zeros.py index de6f90bec..3f2896f1d 100644 --- a/dicp/test/op/test_zeros.py +++ b/dicp/test/op/test_zeros.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args, diff --git a/dicp/test/op/test_zeros_like.py b/dicp/test/op/test_zeros_like.py index 74524b0fc..43d641350 100644 --- a/dicp/test/op/test_zeros_like.py +++ b/dicp/test/op/test_zeros_like.py @@ -1,5 +1,5 @@ import pytest -from common.utils import ( +from ..common.utils import ( torch, dynamo, parse_args,