Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
89ad918
torch wip
chhwang May 27, 2024
ab1998e
Update ut-cuda.yml
chhwang May 27, 2024
ece4f55
torch wip
chhwang May 27, 2024
952b761
runtime module
chhwang May 27, 2024
a409268
fix
chhwang May 27, 2024
8e46227
fix
chhwang May 27, 2024
eee7ec2
some fixes
chhwang May 28, 2024
87b9b01
Python API Multiple Runtime Support (#216)
naturalcandy Jun 18, 2024
9a0556b
cmake dlpack
chhwang Jun 18, 2024
75f7831
include dlpack for pybind
chhwang Jun 18, 2024
94b44f2
support d2d copy
chhwang Jun 24, 2024
20c23f3
lint
chhwang Jun 24, 2024
ebe8560
Seperate DLPack from C++ interfaces
chhwang Jun 25, 2024
08c9b89
Update workflow trigger
chhwang Jun 25, 2024
1fa08af
expose exceptions
chhwang Jun 25, 2024
59caff1
Build python module by default
chhwang Jun 26, 2024
0bf1962
Merge branch 'main' into chhwang/python
chhwang Jun 29, 2024
efb2c78
revert
chhwang Jun 29, 2024
8975f9d
Do not use `sys.path` for importing `_ark_core`
chhwang Jun 29, 2024
153837b
wip
chhwang Jul 2, 2024
ff8c4b8
torch to ark (#217)
naturalcandy Jul 3, 2024
fe35541
wip
chhwang Jul 3, 2024
0cb10b9
fix a reduction perf bug
chhwang Jul 3, 2024
0fde9c5
optimize
chhwang Jul 4, 2024
c4be6d1
wip
chhwang Jul 5, 2024
cc30912
optimization
chhwang Jul 5, 2024
34a87d8
optimize
chhwang Jul 8, 2024
866112d
optimize
chhwang Jul 9, 2024
68e787a
fix bf16 matmul
chhwang Jul 9, 2024
a149abb
Merge branch 'main' into chhwang/python
chhwang Jul 9, 2024
b18bdb2
Enhance executor interfaces
chhwang Jul 10, 2024
2154690
Update lint workflow
chhwang Jul 10, 2024
705f9f8
Optimize operators
chhwang Jul 11, 2024
a3114e4
fix
chhwang Jul 11, 2024
6a0cd1a
Merge branch 'main' into chhwang/fix-kernels
chhwang Jul 11, 2024
d5bc723
Merge branch 'main' into chhwang/executor-interface
chhwang Jul 11, 2024
f01afaa
Merge branch 'chhwang/fix-kernels' into chhwang/executor-interface
chhwang Jul 11, 2024
860a68f
Merge branch 'main' into chhwang/python
chhwang Jul 11, 2024
03361f9
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Jul 11, 2024
6116424
delete an unused file
chhwang Jul 11, 2024
67e3b26
update test
chhwang Jul 11, 2024
f293383
Merge branch 'chhwang/fix-kernels' into chhwang/executor-interface
chhwang Jul 11, 2024
f7a98fc
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Jul 11, 2024
e1f178b
fix merge & updates
chhwang Jul 12, 2024
ce1959e
Add `loop_mode` argument
chhwang Jul 12, 2024
eae8972
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Jul 12, 2024
55755bb
do not force noinline
chhwang Jul 14, 2024
b29eaae
wip
chhwang Jul 14, 2024
cfabc2f
Merge branch 'chhwang/fix-kernels' into chhwang/executor-interface
chhwang Jul 14, 2024
eddabe7
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Jul 14, 2024
a7a5d46
Fix CK tile indexing
chhwang Jul 14, 2024
14f3a97
Merge branch 'chhwang/fix-kernels' into chhwang/executor-interface
chhwang Jul 14, 2024
ce96890
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Jul 14, 2024
c72b907
Merge branch 'main' into chhwang/executor-interface
chhwang Jul 15, 2024
9c19a5e
wip
chhwang Jul 29, 2024
ef3bb84
plan manager
chhwang Jul 29, 2024
7a7f70e
fix
chhwang Jul 30, 2024
a77a2ea
llama example
chhwang Jul 30, 2024
28cf7dd
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Jul 31, 2024
8192b90
Merge branch 'main' into chhwang/executor-interface
chhwang Aug 6, 2024
ffd43fd
Merge branch 'main' into chhwang/executor-interface
chhwang Aug 6, 2024
78ac0da
fix merge
chhwang Aug 6, 2024
afb518a
fix merge
chhwang Aug 6, 2024
01fa569
Merge branch 'main' into chhwang/executor-interface
chhwang Aug 6, 2024
762bf4a
fix merge
chhwang Aug 6, 2024
f654f0b
add a python method
chhwang Aug 6, 2024
498926c
submodule update
chhwang Aug 6, 2024
3e331a2
fix
chhwang Aug 6, 2024
10bfa75
Rename CMake environments
chhwang Aug 6, 2024
745fa1b
Merge branch 'chhwang/cmake' into chhwang/executor-interface
chhwang Aug 6, 2024
3dda44a
A few fixes & improved coverage
chhwang Aug 6, 2024
e96669b
Merge branch 'main' into chhwang/executor-interface
chhwang Aug 6, 2024
dba78c5
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Aug 6, 2024
12b1e58
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Aug 6, 2024
4971601
fix merge
chhwang Aug 6, 2024
6ce576a
Merge branch 'chhwang/python' of https://github.com/microsoft/ark int…
chhwang Aug 6, 2024
28b8395
Update runtime.py
chhwang Aug 6, 2024
11901c4
fix
chhwang Aug 7, 2024
3008e7f
Merge branch 'chhwang/executor-interface' into chhwang/python
chhwang Aug 7, 2024
4ce8142
Merge main into chhwang/python (PR #215)
chhwang Apr 2, 2026
76e23c9
Add Tensor.eval() & reduce bug fix
chhwang Apr 4, 2026
b99cffc
update workflow
chhwang Apr 4, 2026
135fef2
update workflow
chhwang Apr 4, 2026
a3d90d0
lint
chhwang Apr 4, 2026
293c96b
update workflows
chhwang Apr 4, 2026
d0973eb
lint
chhwang Apr 4, 2026
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
104 changes: 0 additions & 104 deletions .github/workflows/codeql.yml

This file was deleted.

15 changes: 6 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,38 @@

jobs:
linters:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install ClangFormat
run: sudo apt-get install -y clang-format

- name: Run git-clang-format
run: git clang-format --style=file --diff

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.12'

- name: Install Python dependencies
run: python3.8 -m pip install black
run: pip install black

- name: Run black
run: python3.8 -m black --check --config pyproject.toml .
- name: Run lint
run: bash tools/lint.sh dry

spelling:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Download misspell
run: |
curl -L https://github.com/client9/misspell/releases/download/v0.3.4/misspell_0.3.4_linux_64bit.tar.gz -o /tmp/misspell_0.3.4_linux_64bit.tar.gz
tar -xzf /tmp/misspell_0.3.4_linux_64bit.tar.gz -C .

- name: Check spelling
run: |
./misspell -error .github ark examples python scripts

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
64 changes: 0 additions & 64 deletions .github/workflows/ut-rocm.yml

This file was deleted.

51 changes: 36 additions & 15 deletions .github/workflows/ut-cuda.yml → .github/workflows/ut.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Unit Tests (CUDA)"
name: "Unit Tests"

on:
push:
Expand All @@ -11,38 +11,50 @@ on:

jobs:
UnitTest:
runs-on: [ self-hosted, A100 ]
defaults:
run:
shell: bash
timeout-minutes: 30
timeout-minutes: 60
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
cuda: [ cuda11.8, cuda12.2 ]
include:
- platform: cuda
runner: [self-hosted, CUDA]
container: nvcr.io/nvidia/pytorch:26.03-py3
container_options: --privileged --ipc=host --gpus=all --ulimit memlock=-1:-1
- platform: rocm
runner: [self-hosted, ROCM]
container: rocm/pytorch:rocm7.2.1_ubuntu24.04_py3.12_pytorch_release_2.9.1
container_options: --privileged --ipc=host --security-opt seccomp=unconfined --group-add video --ulimit memlock=-1:-1
runs-on: ${{ matrix.runner }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.cuda }}
group: ${{ github.workflow }}-${{ matrix.platform }}-${{ github.ref }}
cancel-in-progress: true
container:
image: "ghcr.io/microsoft/ark/ark:base-dev-${{ matrix.cuda }}"
options: --privileged --ipc=host --gpus=all --ulimit memlock=-1:-1
image: ${{ matrix.container }}
options: ${{ matrix.container_options }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: LockGPUClock
run: |
sudo nvidia-smi -pm 1
for i in $(seq 0 $(( $(nvidia-smi -L | wc -l) - 1 ))); do
sudo nvidia-smi -ac $(nvidia-smi --query-gpu=clocks.max.memory,clocks.max.sm --format=csv,noheader,nounits -i $i | sed 's/\ //') -i $i
done

- name: Dubious ownership exception
run: |
git config --global --add safe.directory /__w/ark/ark

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp

- name: Build
run: |
apt-get update && apt-get install -y lcov
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j ut ark_py
Expand All @@ -51,6 +63,10 @@ jobs:
run: |
cd build
ARK_ROOT=$PWD ctest --stop-on-failure --verbose --schedule-random

- name: C++ Coverage
run: |
cd build
lcov --capture --directory . --output-file cpp_coverage.info
lcov --remove cpp_coverage.info \
'/usr/*' \
Expand All @@ -75,7 +91,7 @@ jobs:
--cov=python/ark \
--cov-report lcov:py_coverage.info \
--verbose \
../python/unittest/test.py
../python/unittest/

- name: Report Coverage
env:
Expand All @@ -92,3 +108,8 @@ jobs:
- name: Run Tutorials
run: |
python3 ./examples/tutorial/quickstart_tutorial.py

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:cpp-${{ matrix.platform }}"
4 changes: 1 addition & 3 deletions ark/api/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ void Context::set(const std::string& key, const std::string& value,
this->impl_->set(key, value_json, type);
}

std::string Context::dump() const {
return this->impl_->dump().dump();
}
std::string Context::dump() const { return this->impl_->dump().dump(); }

} // namespace ark
20 changes: 11 additions & 9 deletions ark/api/planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ std::string Planner::Impl::plan(bool pretty) const {
Dims tile(trim_leading_ones);

std::stringstream ss;
ss << "Result shape is not divided by tile "
<< tile << ". Op: " << op->serialize().dump();
ss << "Result shape is not divided by tile " << tile
<< ". Op: " << op->serialize().dump();
auto not_divided_error = ss.str();

auto &result_shape = result_tensors[0]->padded_shape();
Expand All @@ -224,11 +224,10 @@ std::string Planner::Impl::plan(bool pretty) const {
max_num_tasks = 1;
for (int i = 0; i < tile4.ndims(); i++) {
if (tile4[i] == 0) {
ERR(PlanError, "Tile dimension is zero. Op: ",
op->serialize().dump());
ERR(PlanError,
"Tile dimension is zero. Op: ", op->serialize().dump());
}
max_num_tasks *=
(result_shape4[i] + tile4[i] - 1) / tile4[i];
max_num_tasks *= (result_shape4[i] + tile4[i] - 1) / tile4[i];
}
if (max_num_tasks == 0) ERR(InternalError, "max_num_tasks == 0");
}
Expand Down Expand Up @@ -328,10 +327,13 @@ std::string Planner::Impl::plan(bool pretty) const {
max_processor_id = std::max(max_processor_id, num_processors);
} else if (processor_group_root == -1) {
processor_group_root = ctx_processor_range_list.front()[0];
processor_group["ProcessorRange"] = ctx_processor_range_list.front()[1];
resource_group["ProcessorRange"] = ctx_processor_range_list.back()[1];
processor_group["ProcessorRange"] =
ctx_processor_range_list.front()[1];
resource_group["ProcessorRange"] =
ctx_processor_range_list.back()[1];
max_processor_id = std::max(
max_processor_id, ctx_processor_range_list.front()[1][1].get<size_t>());
max_processor_id,
ctx_processor_range_list.front()[1][1].get<size_t>());
} else {
new_processor_group = false;
resource_group["ProcessorRange"] =
Expand Down
Loading
Loading