Skip to content

Commit 6678b33

Browse files
authored
Merge branch 'master' into ck-631
2 parents ce824f3 + 778d829 commit 6678b33

File tree

10 files changed

+417
-391
lines changed

10 files changed

+417
-391
lines changed

.circleci/config.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ commands:
1414
- run:
1515
name: Avoid tests for docs
1616
command: |
17-
if [[ $CIRCLE_BRANCH == *docs* ]]; then
17+
if [[ $CIRCLE_BRANCH == *docs ]]; then
1818
echo "Identifies as documents PR, no testing required"
1919
circleci step halt
2020
fi
@@ -48,12 +48,12 @@ commands:
4848
- run:
4949
name: Relocate docker overlay2 dir
5050
command: |
51-
sudo service docker stop
51+
sudo systemctl stop docker
5252
sudo mkdir -p /var2/lib/docker
5353
sudo mv /var/lib/docker/overlay2 /var2/lib/docker
5454
sudo mkdir /var/lib/docker/overlay2
5555
sudo mount --bind /var2/lib/docker/overlay2 /var/lib/docker/overlay2
56-
sudo service docker start
56+
sudo systemctl start docker
5757
5858
setup-automation:
5959
steps:
@@ -129,8 +129,8 @@ commands:
129129
platforms-build-steps:
130130
steps:
131131
- abort_for_docs
132-
- setup-executor
133132
- checkout-all
133+
- relocate-docker-storage
134134
- setup-automation
135135
- run:
136136
name: Build for platform
@@ -199,11 +199,12 @@ jobs:
199199
platform: debian
200200

201201
platforms-build:
202-
docker:
203-
- image: cimg/base:2020.01
202+
machine:
203+
enabled: true
204+
docker_layer_caching: true
205+
resource_class: gpu.nvidia.small
206+
image: ubuntu-1604-cuda-11.1:202012-01
204207
steps:
205-
- setup-executor
206-
- relocate-docker-storage
207208
- platforms-build-steps
208209

209210
coverage:
@@ -294,7 +295,6 @@ jobs:
294295
make -C opt test VALGRIND=1 <<parameters.test_args>>
295296
no_output_timeout: 120m
296297

297-
298298
# build-macos:
299299
# macos:
300300
# xcode: 11.3.0

.github/workflows/trigger-build-and-test-gpu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
valgrind_general:
1111
if: github.event.label.name == 'ci-test'
1212
runs-on: ubuntu-latest
13-
name: Run build and test cpu
13+
name: Run build and test gpu
1414

1515
steps:
1616
- uses: actions/checkout@v2

opt/clang-check-all.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
set -e
55

66
CLANG_FMT_SRCS=$(find ../src/ \( -name '*.c' -o -name '*.cc'-o -name '*.cpp' -o -name '*.h' -o -name '*.hh' -o -name '*.hpp' \))
7+
CLANG_FMT_TESTS=$(find ../tests/ \( -name '*.c' -o -name '*.cc'-o -name '*.cpp' -o -name '*.h' -o -name '*.hh' -o -name '*.hpp' \))
78

89
for filename in $CLANG_FMT_SRCS; do
910
echo "Checking $filename"
1011
clang-format -style=file -Werror --dry-run $filename
1112
done
13+
14+
for filename in $CLANG_FMT_TESTS; do
15+
echo "Checking $filename"
16+
clang-format -style=file -Werror --dry-run $filename
17+
done

opt/clang-format-all.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
set -e
55

66
CLANG_FMT_SRCS=$(find ../src/ \( -name '*.c' -o -name '*.cc'-o -name '*.cpp' -o -name '*.h' -o -name '*.hh' -o -name '*.hpp' \))
7+
CLANG_FMT_TESTS=$(find ../tests/ \( -name '*.c' -o -name '*.cc'-o -name '*.cpp' -o -name '*.h' -o -name '*.hh' -o -name '*.hpp' \))
78

89
for filename in $CLANG_FMT_SRCS; do
910
clang-format --verbose -style=file -i $filename
1011
done
12+
13+
for filename in $CLANG_FMT_TESTS; do
14+
clang-format --verbose -style=file -i $filename
15+
done

tests/flow/pt_api_test.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,41 @@
44
#include "dlpack/dlpack.h"
55

66
int main() {
7-
printf("Hello from libTorch C library version %s\n", "1.0");
8-
torchBasicTest();
7+
printf("Hello from libTorch C library version %s\n", "1.0");
8+
torchBasicTest();
99

10-
void* ctx;
11-
char *err = NULL;
10+
void *ctx;
11+
char *err = NULL;
1212

13-
const char script[] = "\n\
13+
const char script[] = "\n\
1414
def foo(a): \n\
1515
return a * 2 \n\
1616
";
1717

18-
ctx = torchCompileScript(script, kDLCPU, &err);
19-
if (err) {
20-
printf("ERR: %s\n", err);
21-
free(err);
22-
err = NULL;
23-
return 1;
24-
}
25-
printf("Compiled: %p\n", ctx);
18+
ctx = torchCompileScript(script, kDLCPU, &err);
19+
if (err) {
20+
printf("ERR: %s\n", err);
21+
free(err);
22+
err = NULL;
23+
return 1;
24+
}
25+
printf("Compiled: %p\n", ctx);
2626

27-
DLDataType dtype = (DLDataType){ .code = kDLFloat, .bits = 32, .lanes = 1};
28-
int64_t shape[1] = {1};
29-
int64_t strides[1] = {1};
30-
char data[4] = "0000";
31-
DLManagedTensor* input = torchNewTensor(dtype, 1, shape, strides, data);
32-
DLManagedTensor* output;
33-
torchRunScript(ctx, "foo", 1, &input, 1, &output, &err);
34-
if (err) {
35-
printf("ERR: %s\n", err);
36-
free(err);
37-
return 1;
38-
}
27+
DLDataType dtype = (DLDataType){.code = kDLFloat, .bits = 32, .lanes = 1};
28+
int64_t shape[1] = {1};
29+
int64_t strides[1] = {1};
30+
char data[4] = "0000";
31+
DLManagedTensor *input = torchNewTensor(dtype, 1, shape, strides, data);
32+
DLManagedTensor *output;
33+
torchRunScript(ctx, "foo", 1, &input, 1, &output, &err);
34+
if (err) {
35+
printf("ERR: %s\n", err);
36+
free(err);
37+
return 1;
38+
}
3939

40-
torchDeallocContext(ctx);
41-
printf("Deallocated\n");
40+
torchDeallocContext(ctx);
41+
printf("Deallocated\n");
4242

43-
return 0;
43+
return 0;
4444
}

tests/flow/tests_llapi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ def test_dag_build_and_run(env):
101101
ret = con.execute_command("RAI_llapi.DAGrun")
102102
env.assertEqual(ret, b'DAG run success')
103103

104+
# Run the DAG LLAPI test again with multi process test to ensure that there are no dead-locks
105+
def run_dag_llapi(con):
106+
con.execute_command("RAI_llapi.DAGrun")
107+
108+
run_test_multiproc(env, 500, run_dag_llapi)
109+
104110

105111
@with_test_module
106112
def test_dagrun_multidevice_resnet(env):

tests/flow/tf_api_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#include <tensorflow/c/c_api.h>
33

44
int main() {
5-
printf("Hello from TensorFlow C library version %s\n", TF_Version());
6-
return 0;
5+
printf("Hello from TensorFlow C library version %s\n", TF_Version());
6+
return 0;
77
}

0 commit comments

Comments
 (0)