Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CK GEMM Backend #1480

Draft
wants to merge 58 commits into
base: rocm6.3_internal_testing
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
e023400
[SOW MS3] Centos stream9 PyTorch image support (#1090)
rraminen Aug 30, 2022
b8a2811
Updated to latest conda for CentOS stream 9
pruthvistony Aug 31, 2022
59e9341
Temporarily skip test_conv3d_64bit_indexing
pruthvistony Mar 23, 2023
2bb132f
Enable tensorpipe with hip_basic backend (#1135)
pruthvistony Nov 13, 2022
0b08278
Updates to build on Jammy
pruthvistony Jul 28, 2023
6e7704d
Fix lstsq related regressions (part of SWDEV-392820)
pruthvistony Sep 12, 2023
108bf57
[UB22.04] Updates to support latest scipy
pruthvistony Aug 18, 2023
15da21a
Build required version of libpng for CentOS7
pruthvistony Aug 18, 2023
4003496
Update tensorpipe submodule to support ROCm 6.0
pruthvistony Aug 5, 2023
2cfad86
Set ROCM_PATH in env for centOS docker container
pruthvistony Aug 13, 2023
3c19bf9
Updated condition for libstc++ for Jammy
pruthvistony Sep 5, 2023
b7e47fa
Skip ddp apply_optim_in_bwd tests for gloo (#1302)
jataylo Oct 27, 2023
032320c
Changes to support docker v23
pruthvistony Sep 25, 2023
50d56db
[CS9] Updates to CentOS stream 9 build (#1326)
pruthvistony Nov 28, 2023
17ba54f
Update to hipify mapping
pruthvistony Dec 6, 2023
e00045a
Correcting usage of USE_ROCM
pruthvistony Dec 6, 2023
7f3172f
Enable gesvda for ROCM >= 6.1 (#1339)
xinyazhang Dec 20, 2023
a2d6ace
Increase lifespan of test-times files
pruthvistony Dec 31, 2023
00307cc
Fixes CI build script (#1350)
xinyazhang Jan 26, 2024
3120778
[NO CP] Temporary dumping of test exec log to stderr
pruthvistony Jan 30, 2024
9726c26
Add skipIfRocmArch decorator for Navi skips (#1356)
jataylo Feb 26, 2024
91125f1
Converted NAVI check as a function (#1364)
BLOrange-AMD Mar 7, 2024
623579f
Triton build conditionalized on ROCM_VERSION
pruthvistony Mar 8, 2024
b39d5fa
Remove ROCmloops specific test
pruthvistony Mar 12, 2024
6d3494e
Bad import in test_torchinductor and skip torchvision related UT (#1374)
pragupta Mar 20, 2024
f02e87f
skip test_inductor_freezing failing UTs (#1375)
pragupta Mar 20, 2024
c1f1f51
Skip test_mm_triton_kernel_benchmark (#1376)
pragupta Mar 21, 2024
3720952
Implementation of PyTorch ut parsing script - QA helper function (#1386)
BLOrange-AMD Apr 18, 2024
6f65d22
[HIP] Returned error string update
pruthvistony May 13, 2024
98df198
PR #1255 to rocm6.2 release
ramcherukuri May 15, 2024
f18c060
[ROCm] skip warp update to 64 for gfx10 and gfx11 (#1417)
ramcherukuri May 15, 2024
cb0e9ad
Reformat test_float8_basics for current rocm support (#1415)
alugorey May 16, 2024
b4abc4b
Enable e5m2 x e4m3 test in test_float8_scale (#1419)
alugorey May 16, 2024
c716c2e
[release/2.1] Skip certificate check for CentOS7 since certificate ex…
jithunnair-amd Apr 24, 2024
09b800a
skip vmapvjpvjp_linalg_householder_product_cuda_float32 (#1420)
alugorey May 21, 2024
a0872c0
Include the ROCm version in triton version
pruthvistony May 21, 2024
700ee13
Change Torch extra install requirement
pruthvistony May 22, 2024
8f95824
Remove the installation of rocm-llvm-dev package
pruthvistony May 22, 2024
5f9b3f4
Fix SWDEV-459623 (#1428)
xinyazhang Jun 2, 2024
90df487
Enable fp8 inductor unit tests (#1421)
alugorey Jun 2, 2024
4380b15
Enable NHWC batchnorm for miopen (#1400)
dnikolaev-amd Jun 4, 2024
a390471
[HIP] Few more updates to the returned error string
pruthvistony Jun 11, 2024
6be1d5d
skipIfRocm needs msg parameter
jithunnair-amd Jun 13, 2024
31b3681
[NO CP] Updated changes to skip few UTs
pruthvistony Jun 13, 2024
cefda3a
Add new kernel config for AMD GPUs
jerrymannil Apr 17, 2024
8068d3d
Update gesvda USE_ROCM guards
dnikolaev-amd Jun 20, 2024
5187ca9
Print consolidated log file for pytorch unit test automation scripts …
jithunnair-amd Jun 18, 2024
0c2f97c
[ROCm] Intra-node all reduce initial implementation (#1435)
jataylo Jun 18, 2024
012c13b
Scale XBLOCK in triton reduction configs to avoid hitting max grid (#…
jataylo Jun 18, 2024
6e45ab1
rocm6.3 related_commits
dnikolaev-amd Jun 20, 2024
3aa060d
caching test_times
dnikolaev-amd Jun 20, 2024
0c5d257
Sync updates from hipify_torch. (#1168)
wenchenvincent Feb 14, 2023
ecf4e8d
fix install_centos() function
dnikolaev-amd Jun 20, 2024
8f19207
Merge pull request #1436 from ROCm/IFU_CP_06172024
pruthvistony Jun 26, 2024
5de711c
Update apex commit to pick up wheel-related changes (#1443)
jithunnair-amd Jun 27, 2024
4459b67
increase tensor size to force out of memory exception on MI300X (#1449)
dnikolaev-amd Jul 8, 2024
dd43b9b
Update clock info metric AMDSMI (#1459)
jataylo Jul 10, 2024
1b6b84e
CK GEMM Backend
jeffdaily Jun 26, 2024
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
1 change: 1 addition & 0 deletions .additional_ci_files/test-class-times.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .additional_ci_files/test-times.json

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions .automation_scripts/parse_xml_results.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
""" The Python PyTorch testing script.
##
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""

import xml.etree.ElementTree as ET
from pathlib import Path
from typing import Any, Dict, Tuple

# Backends list
BACKENDS_LIST = [
"dist-gloo",
"dist-nccl"
]

TARGET_WORKFLOW = "--rerun-disabled-tests"

def get_job_id(report: Path) -> int:
# [Job id in artifacts]
# Retrieve the job id from the report path. In our GHA workflows, we append
# the job id to the end of the report name, so `report` looks like:
# unzipped-test-reports-foo_5596745227/test/test-reports/foo/TEST-foo.xml
# and we want to get `5596745227` out of it.
try:
return int(report.parts[0].rpartition("_")[2])
except ValueError:
return -1

def is_rerun_disabled_tests(root: ET.ElementTree) -> bool:
"""
Check if the test report is coming from rerun_disabled_tests workflow
"""
skipped = root.find(".//*skipped")
# Need to check against None here, if not skipped doesn't work as expected
if skipped is None:
return False

message = skipped.attrib.get("message", "")
return TARGET_WORKFLOW in message or "num_red" in message

def parse_xml_report(
tag: str,
report: Path,
workflow_id: int,
workflow_run_attempt: int,
work_flow_name: str
) -> Dict[Tuple[str], Dict[str, Any]]:
"""Convert a test report xml file into a JSON-serializable list of test cases."""
print(f"Parsing {tag}s for test report: {report}")

job_id = get_job_id(report)
print(f"Found job id: {job_id}")

test_cases: Dict[Tuple[str], Dict[str, Any]] = {}

root = ET.parse(report)
# TODO: unlike unittest, pytest-flakefinder used by rerun disabled tests for test_ops
# includes skipped messages multiple times (50 times by default). This slows down
# this script too much (O(n)) because it tries to gather all the stats. This should
# be fixed later in the way we use pytest-flakefinder. A zipped test report from rerun
# disabled test is only few MB, but will balloon up to a much bigger XML file after
# extracting from a dozen to few hundred MB
if is_rerun_disabled_tests(root):
return test_cases

for test_case in root.iter(tag):
case = process_xml_element(test_case)
if tag == 'testcase':
case["workflow_id"] = workflow_id
case["workflow_run_attempt"] = workflow_run_attempt
case["job_id"] = job_id
case["work_flow_name"] = work_flow_name

# [invoking file]
# The name of the file that the test is located in is not necessarily
# the same as the name of the file that invoked the test.
# For example, `test_jit.py` calls into multiple other test files (e.g.
# jit/test_dce.py). For sharding/test selection purposes, we want to
# record the file that invoked the test.
#
# To do this, we leverage an implementation detail of how we write out
# tests (https://bit.ly/3ajEV1M), which is that reports are created
# under a folder with the same name as the invoking file.
case_name = report.parent.name
for ind in range(len(BACKENDS_LIST)):
if BACKENDS_LIST[ind] in report.parts:
case_name = case_name + "_" + BACKENDS_LIST[ind]
break
case["invoking_file"] = case_name
test_cases[ ( case["invoking_file"], case["classname"], case["name"], case["work_flow_name"] ) ] = case
elif tag == 'testsuite':
case["work_flow_name"] = work_flow_name
case["invoking_file"] = report.parent.name
case["invoking_xml"] = report.name
case["running_time_xml"] = case["time"]
test_cases[ ( case["invoking_file"], case["invoking_xml"], case["work_flow_name"] ) ] = case

return test_cases

def process_xml_element(element: ET.Element) -> Dict[str, Any]:
"""Convert a test suite element into a JSON-serializable dict."""
ret: Dict[str, Any] = {}

# Convert attributes directly into dict elements.
# e.g.
# <testcase name="test_foo" classname="test_bar"></testcase>
# becomes:
# {"name": "test_foo", "classname": "test_bar"}
ret.update(element.attrib)

# The XML format encodes all values as strings. Convert to ints/floats if
# possible to make aggregation possible in Rockset.
for k, v in ret.items():
try:
ret[k] = int(v)
except ValueError:
pass
try:
ret[k] = float(v)
except ValueError:
pass

# Convert inner and outer text into special dict elements.
# e.g.
# <testcase>my_inner_text</testcase> my_tail
# becomes:
# {"text": "my_inner_text", "tail": " my_tail"}
if element.text and element.text.strip():
ret["text"] = element.text
if element.tail and element.tail.strip():
ret["tail"] = element.tail

# Convert child elements recursively, placing them at a key:
# e.g.
# <testcase>
# <foo>hello</foo>
# <foo>world</foo>
# <bar>another</bar>
# </testcase>
# becomes
# {
# "foo": [{"text": "hello"}, {"text": "world"}],
# "bar": {"text": "another"}
# }
for child in element:
if child.tag not in ret:
ret[child.tag] = process_xml_element(child)
else:
# If there are multiple tags with the same name, they should be
# coalesced into a list.
if not isinstance(ret[child.tag], list):
ret[child.tag] = [ret[child.tag]]
ret[child.tag].append(process_xml_element(child))
return ret
Loading