You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tq...@apache.org on 2025/02/15 14:45:54 UTC
(tvm) branch refactor updated (9a76915b33 -> 6a34d95c3e)
This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a change to branch refactor
in repository https://gitbox.apache.org/repos/asf/tvm.git
from 9a76915b33 lint
new 570f58e0cd remove astext
new 6a34d95c3e Remove cpptest on gpu stage as it can be very slow on GPU nodes, cpptest should only run on cpu and test most basic stuffs
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
ci/jenkins/generated/gpu_jenkinsfile.groovy | 125 +++----------------------
ci/jenkins/templates/gpu_jenkinsfile.groovy.j2 | 27 +-----
python/tvm/dlight/benchmark/utils.py | 2 +-
python/tvm/ir/expr.py | 30 ------
python/tvm/ir/module.py | 28 ------
python/tvm/ir/op.py | 28 ------
python/tvm/target/datatype.py | 4 +-
7 files changed, 19 insertions(+), 225 deletions(-)
(tvm) 01/02: remove astext
Posted by tq...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch refactor
in repository https://gitbox.apache.org/repos/asf/tvm.git
commit 570f58e0cde48ec46139684bb8079999e509e2af
Author: tqchen <ti...@gmail.com>
AuthorDate: Sat Feb 15 09:30:43 2025 -0500
remove astext
---
python/tvm/dlight/benchmark/utils.py | 2 +-
python/tvm/ir/expr.py | 30 ------------------------------
python/tvm/ir/module.py | 28 ----------------------------
python/tvm/ir/op.py | 28 ----------------------------
python/tvm/target/datatype.py | 4 ++--
5 files changed, 3 insertions(+), 89 deletions(-)
diff --git a/python/tvm/dlight/benchmark/utils.py b/python/tvm/dlight/benchmark/utils.py
index 72e0ac8de0..8edb2addae 100644
--- a/python/tvm/dlight/benchmark/utils.py
+++ b/python/tvm/dlight/benchmark/utils.py
@@ -37,7 +37,7 @@ def get_func_name_from_gv(gv: tvm.ir.GlobalVar) -> str: # pylint: disable=inval
result : str
The global variable name without the prefix "...@".
"""
- return gv.astext().split("@")[1] if "@" in gv.astext() else gv.astext()
+ return gv.name_hint
def dym_var_sample_str(sample: Dict[Union[str, tvm.relax.expr.Call], int]) -> str:
diff --git a/python/tvm/ir/expr.py b/python/tvm/ir/expr.py
index 543ea00214..3c173baa15 100644
--- a/python/tvm/ir/expr.py
+++ b/python/tvm/ir/expr.py
@@ -116,36 +116,6 @@ class GlobalVar(RelayExpr):
arg_types = [type(x) for x in args]
raise RuntimeError(f"Do not know how to handle GlobalVar.__call__ for types {arg_types}")
- def astext(
- self, show_meta_data: bool = True, annotate: Optional[Callable[[Object], str]] = None
- ) -> str:
- """Get the text format of the expression.
-
- Parameters
- ----------
- show_meta_data : bool
- Whether to include meta data section in the text
- if there is meta data.
-
- annotate: Optional[Object->str]
- Optionally annotate function to provide additional
- information in the comment block.
-
- Returns
- -------
- text : str
- The text format of the expression.
-
- Notes
- -----
- The meta data section is necessary to fully parse the text format.
- However, it can contain dumps that are big (e.g constant weights),
- so it can be helpful to skip printing the meta data section.
- """
- from tvm.relay import astext # pylint: disable=import-outside-toplevel
-
- return astext(self, show_meta_data, annotate)
-
@tvm._ffi.register_object
class Range(Node, Scriptable):
diff --git a/python/tvm/ir/module.py b/python/tvm/ir/module.py
index 3c76dbfdd8..9ee87c5224 100644
--- a/python/tvm/ir/module.py
+++ b/python/tvm/ir/module.py
@@ -395,31 +395,3 @@ class IRModule(Node, Scriptable):
attr_map = attr_map._dict()
return _ffi_api.Module_WithAttrs(self, attr_map)
-
- def astext(self, show_meta_data=True, annotate=None):
- """Get the text format of the expression.
-
- Parameters
- ----------
- show_meta_data : bool
- Whether to include meta data section in the text
- if there is meta data.
-
- annotate: Optional[Object->str]
- Optionally annotate function to provide additional
- information in the comment block.
-
- Returns
- -------
- text : str
- The text format of the expression.
-
- Notes
- -----
- The meta data section is necessary to fully parse the text format.
- However, it can contain dumps that are big (e.g constant weights),
- so it can be helpful to skip printing the meta data section.
- """
- from tvm.relay import astext # pylint: disable=import-outside-toplevel
-
- return astext(self, show_meta_data, annotate)
diff --git a/python/tvm/ir/op.py b/python/tvm/ir/op.py
index 70aba97951..3ab5bb55c0 100644
--- a/python/tvm/ir/op.py
+++ b/python/tvm/ir/op.py
@@ -29,34 +29,6 @@ class Op(RelayExpr):
def __init__(self):
raise RuntimeError("Cannot create op, use get instead")
- def astext(self, show_meta_data=True, annotate=None):
- """Get the text format of the expression.
-
- Parameters
- ----------
- show_meta_data : bool
- Whether to include meta data section in the text
- if there is meta data.
-
- annotate: Optional[Object->str]
- Optionally annotate function to provide additional
- information in the comment block.
-
- Returns
- -------
- text : str
- The text format of the expression.
-
- Notes
- -----
- The meta data section is necessary to fully parse the text format.
- However, it can contain dumps that are big (e.g constant weights),
- so it can be helpful to skip printing the meta data section.
- """
- from tvm.relay import astext # pylint: disable=import-outside-toplevel
-
- return astext(self, show_meta_data, annotate)
-
@staticmethod
def get(op_name):
"""Get the Op for a given name
diff --git a/python/tvm/target/datatype.py b/python/tvm/target/datatype.py
index 03dfb9995e..aaf30afaf5 100644
--- a/python/tvm/target/datatype.py
+++ b/python/tvm/target/datatype.py
@@ -303,7 +303,7 @@ def create_lower_func(extern_func_map):
key = (src_bits, t.bits)
if key not in extern_func_map:
- raise RuntimeError(f"missing key {key} in extern_func_map for {op.astext()}")
+ raise RuntimeError(f"missing key {key} in extern_func_map for {op}")
if isinstance(op, _Cast):
return call_pure_extern(dtype, extern_func_map[key], op.value)
@@ -314,7 +314,7 @@ def create_lower_func(extern_func_map):
if isinstance(op, _BinaryOpExpr):
return call_pure_extern(dtype, extern_func_map[key], op.a, op.b)
- raise RuntimeError(f"lowering unsupported op: {op.astext()}")
+ raise RuntimeError(f"lowering unsupported op: {op}")
return lower
(tvm) 02/02: Remove cpptest on gpu stage as it can be very slow on GPU nodes, cpptest should only run on cpu and test most basic stuffs
Posted by tq...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch refactor
in repository https://gitbox.apache.org/repos/asf/tvm.git
commit 6a34d95c3ed2636516018db3f3075ee5a308b815
Author: tqchen <ti...@gmail.com>
AuthorDate: Sat Feb 15 09:45:13 2025 -0500
Remove cpptest on gpu stage as it can be very slow on GPU nodes, cpptest should only run on cpu and test most basic stuffs
---
ci/jenkins/generated/gpu_jenkinsfile.groovy | 125 +++----------------------
ci/jenkins/templates/gpu_jenkinsfile.groovy.j2 | 27 +-----
2 files changed, 16 insertions(+), 136 deletions(-)
diff --git a/ci/jenkins/generated/gpu_jenkinsfile.groovy b/ci/jenkins/generated/gpu_jenkinsfile.groovy
index 89d7784705..3d3f3175c3 100644
--- a/ci/jenkins/generated/gpu_jenkinsfile.groovy
+++ b/ci/jenkins/generated/gpu_jenkinsfile.groovy
@@ -60,7 +60,7 @@
// 'python3 jenkins/generate.py'
// Note: This timestamp is here to ensure that updates to the Jenkinsfile are
// always rebased on main before merging:
-// Generated at 2025-02-14T17:21:20.702568
+// Generated at 2025-02-15T09:43:05.709342
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
// These are set at runtime from data in ci/jenkins/docker-images.yml, update
@@ -541,7 +541,7 @@ build()
-def shard_run_unittest_GPU_1_of_3(node_type) {
+def shard_run_unittest_GPU_1_of_2(node_type) {
echo 'Begin running on node_type ' + node_type
if (!skip_ci && is_docs_only_build != 1) {
node(node_type) {
@@ -553,38 +553,10 @@ def shard_run_unittest_GPU_1_of_3(node_type) {
withEnv([
'PLATFORM=gpu',
'TEST_STEP_NAME=unittest: GPU',
- 'TVM_NUM_SHARDS=3',
+ 'TVM_NUM_SHARDS=2',
'TVM_SHARD_INDEX=0',
"SKIP_SLOW_TESTS=${skip_slow_tests}"], {
- sh(
- script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu2",
- label: 'Download artifacts from S3',
- )
-
- sh "${docker_run} --no-gpu ${ci_gpu} ./tests/scripts/task_config_build_gpu_other.sh build"
- // These require a GPU to finish the build (i.e. CUDA needs to be load-able)
- // make_cpp_tests(ci_gpu, 'build')
- // cpp_unittest(ci_gpu)
-
- sh "rm -rf build"
- sh(
- script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu",
- label: 'Download artifacts from S3',
- )
-
- ci_setup(ci_gpu)
- sh "${docker_run} --no-gpu ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh build"
- make_cpp_tests(ci_gpu, 'build')
- cpp_unittest(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} python3 ./tests/scripts/task_build.py --sccache-bucket tvm-sccache-prod --sccache-region us-west-2 --cmake-target opencl-cpptest --build-dir build",
- label: 'Make OpenCL cpp unit tests',
- )
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_opencl_cpp_unittest.sh",
- label: 'Run OpenCL cpp unit tests',
- )
- sh (
+ sh (
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
label: 'Run Python GPU unit tests',
)
@@ -609,11 +581,11 @@ def shard_run_unittest_GPU_1_of_3(node_type) {
}
echo 'End running on node_type ' + node_type
} else {
- Utils.markStageSkippedForConditional('unittest: GPU 1 of 3')
+ Utils.markStageSkippedForConditional('unittest: GPU 1 of 2')
}
}
-def shard_run_unittest_GPU_2_of_3(node_type) {
+def shard_run_unittest_GPU_2_of_2(node_type) {
echo 'Begin running on node_type ' + node_type
if (!skip_ci && is_docs_only_build != 1) {
node(node_type) {
@@ -625,16 +597,10 @@ def shard_run_unittest_GPU_2_of_3(node_type) {
withEnv([
'PLATFORM=gpu',
'TEST_STEP_NAME=unittest: GPU',
- 'TVM_NUM_SHARDS=3',
+ 'TVM_NUM_SHARDS=2',
'TVM_SHARD_INDEX=1',
"SKIP_SLOW_TESTS=${skip_slow_tests}"], {
- sh(
- script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu",
- label: 'Download artifacts from S3',
- )
-
- ci_setup(ci_gpu)
- sh (
+ sh (
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh",
label: 'Run Java unit tests',
)
@@ -663,57 +629,7 @@ def shard_run_unittest_GPU_2_of_3(node_type) {
}
echo 'End running on node_type ' + node_type
} else {
- Utils.markStageSkippedForConditional('unittest: GPU 2 of 3')
- }
-}
-
-def shard_run_unittest_GPU_3_of_3(node_type) {
- echo 'Begin running on node_type ' + node_type
- if (!skip_ci && is_docs_only_build != 1) {
- node(node_type) {
- ws("workspace/exec_${env.EXECUTOR_NUMBER}/tvm/ut-python-gpu") {
- // NOTE: if exception happens, it will be caught outside
- init_git()
- docker_init(ci_gpu)
- timeout(time: max_time, unit: 'MINUTES') {
- withEnv([
- 'PLATFORM=gpu',
- 'TEST_STEP_NAME=unittest: GPU',
- 'TVM_NUM_SHARDS=3',
- 'TVM_SHARD_INDEX=2',
- "SKIP_SLOW_TESTS=${skip_slow_tests}"], {
- sh(
- script: "./${jenkins_scripts_root}/s3.py --action download --bucket ${s3_bucket} --prefix ${s3_prefix}/gpu",
- label: 'Download artifacts from S3',
- )
-
- ci_setup(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh",
- label: 'Run Python GPU unit tests',
- )
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh",
- label: 'Run Python GPU integration tests',
- )
- })
- }
- // only run upload if things are successful
- try {
- sh(
- script: "./${jenkins_scripts_root}/s3.py --action upload --bucket ${s3_bucket} --prefix ${s3_prefix}/pytest-results/unittest_GPU --items build/pytest-results",
- label: 'Upload JUnits to S3',
- )
-
- junit 'build/pytest-results/*.xml'
- } catch (Exception e) {
- echo 'Exception during JUnit upload: ' + e.toString()
- }
- }
- }
- echo 'End running on node_type ' + node_type
- } else {
- Utils.markStageSkippedForConditional('unittest: GPU 3 of 3')
+ Utils.markStageSkippedForConditional('unittest: GPU 2 of 2')
}
}
@@ -783,37 +699,26 @@ def test() {
SKIP_SLOW_TESTS = "${skip_slow_tests}"
}
parallel(
- 'unittest: GPU 1 of 3': {
- try {
- shard_run_unittest_GPU_1_of_3('GPU-SPOT')
- } catch (Throwable ex) {
- // mark the current stage as success
- // and try again via on demand node
- echo 'Exception during SPOT run ' + ex.toString() + ' retry on-demand'
- currentBuild.result = 'SUCCESS'
- shard_run_unittest_GPU_1_of_3('GPU')
- }
- },
- 'unittest: GPU 2 of 3': {
+ 'unittest: GPU 1 of 2': {
try {
- shard_run_unittest_GPU_2_of_3('GPU-SPOT')
+ shard_run_unittest_GPU_1_of_2('GPU-SPOT')
} catch (Throwable ex) {
// mark the current stage as success
// and try again via on demand node
echo 'Exception during SPOT run ' + ex.toString() + ' retry on-demand'
currentBuild.result = 'SUCCESS'
- shard_run_unittest_GPU_2_of_3('GPU')
+ shard_run_unittest_GPU_1_of_2('GPU')
}
},
- 'unittest: GPU 3 of 3': {
+ 'unittest: GPU 2 of 2': {
try {
- shard_run_unittest_GPU_3_of_3('GPU-SPOT')
+ shard_run_unittest_GPU_2_of_2('GPU-SPOT')
} catch (Throwable ex) {
// mark the current stage as success
// and try again via on demand node
echo 'Exception during SPOT run ' + ex.toString() + ' retry on-demand'
currentBuild.result = 'SUCCESS'
- shard_run_unittest_GPU_3_of_3('GPU')
+ shard_run_unittest_GPU_2_of_2('GPU')
}
},
'docs: GPU 1 of 1': {
diff --git a/ci/jenkins/templates/gpu_jenkinsfile.groovy.j2 b/ci/jenkins/templates/gpu_jenkinsfile.groovy.j2
index 0adb492b98..1d025f0160 100644
--- a/ci/jenkins/templates/gpu_jenkinsfile.groovy.j2
+++ b/ci/jenkins/templates/gpu_jenkinsfile.groovy.j2
@@ -40,37 +40,12 @@
{% call(shard_index, num_shards) m.sharded_test_step(
name="unittest: GPU",
- num_shards=3,
+ num_shards=2,
ws="tvm/ut-python-gpu",
platform="gpu",
docker_image="ci_gpu",
test_method_names=test_method_names,
) %}
- {% if shard_index == 1 %}
- {{ m.download_artifacts(tag='gpu2') }}
- sh "${docker_run} --no-gpu ${ci_gpu} ./tests/scripts/task_config_build_gpu_other.sh build"
- // These require a GPU to finish the build (i.e. CUDA needs to be load-able)
- // make_cpp_tests(ci_gpu, 'build')
- // cpp_unittest(ci_gpu)
-
- sh "rm -rf build"
- {{ m.download_artifacts(tag='gpu') }}
- ci_setup(ci_gpu)
- sh "${docker_run} --no-gpu ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh build"
- make_cpp_tests(ci_gpu, 'build')
- cpp_unittest(ci_gpu)
- sh (
- script: "${docker_run} ${ci_gpu} python3 ./tests/scripts/task_build.py --sccache-bucket tvm-sccache-prod --sccache-region us-west-2 --cmake-target opencl-cpptest --build-dir build",
- label: 'Make OpenCL cpp unit tests',
- )
- sh (
- script: "${docker_run} ${ci_gpu} ./tests/scripts/task_opencl_cpp_unittest.sh",
- label: 'Run OpenCL cpp unit tests',
- )
- {% else %}
- {{ m.download_artifacts(tag='gpu') }}
- ci_setup(ci_gpu)
- {% endif %}
{% if shard_index == 2 or num_shards < 2 %}
sh (
script: "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh",