Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 25 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
runs-on: ubuntu-latest
env:
PLATFORM: cpu
DOCKER_RUN: docker/bash.sh --env PLATFORM --env SKIP_SLOW_TESTS --env TEST_STEP_NAME
DOCKER_RUN: docker/bash.sh --env PLATFORM --env SKIP_SLOW_TESTS --env TEST_STEP_NAME
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -196,7 +196,7 @@ jobs:
run: >-
$DOCKER_RUN $IMAGE ./tests/scripts/task_config_build_cpu.sh build &&
echo "set(USE_MACA OFF)" >> build/config.cmake &&
$DOCKER_RUN $IMAGE tests/scripts/task_build.py --build-dir build &&
$DOCKER_RUN $IMAGE tests/scripts/task_build.py --build-dir build &&
$DOCKER_RUN $IMAGE ./tests/scripts/task_build.py --build-dir build --cmake-target cpptest
- name: Run CPP unit test
shell: bash -l {0}
Expand All @@ -210,4 +210,26 @@ jobs:
$DOCKER_RUN $IMAGE ./tests/scripts/task_python_unittest.sh
env:
TEST_STEP_NAME: "CPU unittest: python"

Ci_Lint:
if: ${{ github.repository == 'MetaX-MACA/mcTVM' }}
runs-on: ubuntu-latest
env:
PLATFORM: cpu
DOCKER_RUN: docker/bash.sh --env CI --env PLATFORM --env TVM_SHARD_INDEX --env TVM_NUM_SHARDS --env RUN_DISPLAY_URL --env PLATFORM --env SKIP_SLOW_TESTS --env TEST_STEP_NAME
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Pull Image
shell: bash -l {0}
run: >-
python ./ci/scripts/jenkins/determine_docker_images.py ci_lint &&
image=$(cat .docker-image-names/ci_lint) &&
docker pull $image &&
echo "IMAGE=$image" >> $GITHUB_ENV
- name: Run Lint
shell: bash -l {0}
run: >-
$DOCKER_RUN $IMAGE ./tests/scripts/task_lint.sh
env:
TEST_STEP_NAME: "Lint"
22 changes: 10 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,56 +31,53 @@
# - $ pre-commit run
#

default_language_version:
python: python3.6
fail_fast: True
default_stages: [push]
default_stages: [pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
stages: [push]
- id: trailing-whitespace
stages: [push]

- repo: local
hooks:
- id: run-black
name: Running Black...
entry: docker/lint.sh python_format
entry: script -q -c "bash docker/lint.sh -i python_format" /dev/null
language: system
always_run: true
pass_filenames: false
- id: run-file-checks
name: Checking File Types....
entry: docker/lint.sh file_type
entry: script -q -c "bash docker/lint.sh file_type" /dev/null
language: system
always_run: true
pass_filenames: false
- id: run-headers-check
name: Checking ASF License Headers ...
entry: docker/lint.sh asf
entry: script -q -c "bash docker/lint.sh asf" /dev/null
language: system
always_run: true
pass_filenames: false
- id: run-headers-check
name: Linting the C++ code ...
entry: docker/lint.sh cpplint
entry: script -q -c "bash docker/lint.sh cpplint" /dev/null
language: system
always_run: true
pass_filenames: false
- id: run-clang-format
name: Checking Clang format ...
entry: docker/lint.sh clang_format
entry: script -q -c "bash docker/lint.sh clang_format" /dev/null
language: system
always_run: true
pass_filenames: false
- id: run-mypy
name: Type Checking with MyPY ...
entry: docker/lint.sh mypy
entry: script -q -c "bash docker/lint.sh mypy" /dev/null
language: system
always_run: true
pass_filenames: false
Expand All @@ -90,3 +87,4 @@ repos:
language: system
always_run: true
pass_filenames: false
stages: [commit]
9 changes: 5 additions & 4 deletions python/tvm/contrib/mxcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import re
import subprocess
import os
from os.path import join, exists

import tvm.ffi
import tvm.runtime
Expand All @@ -28,7 +27,9 @@
from . import utils


def compile_maca(code, target_format="mcbin", arch=None, options=None, path_target=None):
def compile_maca(
code, target_format="mcbin", arch=None, options=None, path_target=None
): # pylint: disable=unused-argument
"""Compile maca code with MXCC from env.

Parameters
Expand Down Expand Up @@ -175,7 +176,7 @@ def have_fp16(compute_version):
compute_version: str
compute capability of a GPU (e.g. "6.0")
"""
major, minor = parse_compute_version(compute_version)
major, minor = parse_compute_version(compute_version) # pylint: disable=unused-variable
if major >= 10:
return True

Expand Down Expand Up @@ -287,7 +288,7 @@ def get_target_compute_version(target=None):


@tvm.ffi.register_func("tvm.contrib.mxcc.supports_fp8")
def have_fp8(compute_version):
def have_fp8(compute_version): # pylint: disable=unused-argument
"""Whether fp8 support is provided in the specified compute capability or not

Parameters
Expand Down
4 changes: 1 addition & 3 deletions python/tvm/tir/tensor_intrin/maca.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
# under the License.
# pylint: disable=invalid-name,missing-function-docstring,unused-variable
"""Intrinsics for tensorization on MetaX GPU."""
from typing import Dict, Literal, Optional, Tuple
from typing import Dict, Literal, Tuple

from tvm.ffi import register_func
from tvm.runtime import convert
from tvm.script import tir as T
from tvm.tir import Cast, IntImm, TensorIntrin
from tvm.tir.function import PrimFunc
Expand Down
2 changes: 1 addition & 1 deletion src/meta_schedule/schedule_rule/schedule_rule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ Array<ScheduleRule> ScheduleRule::DefaultMACA() {
}

Array<ScheduleRule> ScheduleRule::DefaultMACAWMMA() {
// TODO: ENABLE MMA OF MACA
// TODO(metax): ENABLE MMA OF MACA
Array<Map<String, String>> wmma_intrin_groups = {
// Tensor Cores f32 += f32 * f32
{
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/maca/maca_device_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class MACADeviceAPI final : public DeviceAPI {
return;
}
case kApiVersion: {
//*rv = MACA_VERSION;
// *rv = MACA_VERSION;
return;
}
case kDriverVersion:
Expand Down
7 changes: 4 additions & 3 deletions src/target/source/codegen_maca.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <tvm/tir/index_map.h>
#include <tvm/tir/stmt_functor.h>

#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
Expand Down Expand Up @@ -1152,9 +1153,9 @@ void CodeGenMACA::VisitStmt_(const AttrStmtNode* op) {
auto wait_attrs = GetAsyncWaitAttributes(op);
auto queue_id = wait_attrs.first.as<IntImmNode>();
ICHECK(queue_id && queue_id->value == 0) << "For MACA, the index of an async queue must be 0.";
// TODO: Because the data type of the operation written into this block cannot be obtained
// temporarily, for a barrier_arrive_and_wait function that only involves one type of data,
// assume that if there is a method to obtain it in the future, replace the bit here.
// TODO(metax): Because the data type of the operation written into this block cannot be
// obtained temporarily, for a barrier_arrive_and_wait function that only involves one type
// of data,assume that if there is a method to obtain it in the future, replace the bit here.
std::string bit = "";
std::string mask_ = "";
for (const auto& pair : mcDummyRetNum) {
Expand Down
1 change: 1 addition & 0 deletions src/target/source/codegen_maca.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>

#include "codegen_c.h"

Expand Down
1 change: 1 addition & 0 deletions tests/lint/check_file_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"groovy",
# Python-parseable config files
"ini",
"png",
}

# List of file names allowed
Expand Down
Loading