Skip to content

Commit

Permalink
[ci] Lint for trailing newlines and spaces (apache#13058)
Browse files Browse the repository at this point in the history
This adds a short lint to ensure that all files have a single trailing newline and no trailing whitespaces. This PR is in two commits, one to add the check and another to fix currently offending files in the repo. See apache@ba2c2e2 for just the significant changes. Auto-corrections applied with

```
pre-commit run --all-files
```
  • Loading branch information
driazati authored Oct 19, 2022
1 parent 0b48367 commit a4840e7
Show file tree
Hide file tree
Showing 154 changed files with 466 additions and 415 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Jenkinsfile linguist-generated=true

1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ Otherwise, specify what actions should be taken to provide additional clarity/re
Please refer to the list of label tags [here](https://github.com/apache/tvm/wiki/Issue-Triage-Labels) to find the relevant tags and add them below in a bullet format (example below).

* needs-triage

1 change: 0 additions & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ runs:
run: |
conda info
conda list
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ updates:
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 0
open-pull-requests-limit: 0
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON \
-DUSE_IOS_RPC=ON"
mkdir build-ios-simulator
cd build-ios-simulator
cmake .. ${CMAKE_FLAGS}
Expand Down Expand Up @@ -164,4 +164,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: android_camera-debug.apk
path: ./apps/android_camera/app/build/outputs/apk/debug/app-debug.apk
path: ./apps/android_camera/app/build/outputs/apk/debug/app-debug.apk
1 change: 0 additions & 1 deletion 3rdparty/libcrc/tab/gentab_ccitt.inc
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,3 @@ const uint16_t crc_tabccitt[256] = {
0x0ED1u,
0x1EF0u
};

2 changes: 0 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2770,5 +2770,3 @@ We also make major improvements in supporting new backends: ROCm for AMDGPUs and
- DLPack integration support
- AOT and module system
- Basic code structure ready.


2 changes: 1 addition & 1 deletion apps/android_camera/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ ifdef ADD_LDLIBS
LOCAL_LDLIBS += $(ADD_LDLIBS)
endif

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_SHARED_LIBRARY)
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000"
tools:context="org.apache.tvm.android.androidcamerademo.MainActivity" />
tools:context="org.apache.tvm.android.androidcamerademo.MainActivity" />
2 changes: 1 addition & 1 deletion apps/android_camera/models/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
keras==2.9
mxnet
scipy
tensorflow==2.9.1
tensorflow==2.9.1
4 changes: 2 additions & 2 deletions apps/android_deploy/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ project.ext.ASSET_DIR = projectDir.toString() + '/src/main/assets'
project.ext.TMP_DIR = project.buildDir.toString() + '/downloads'

// Download default models(darknet framework extraction model compiled version);
// if you wish to use your own models then place them in the "assets" directory
// if you wish to use your own models then place them in the "assets" directory
// and comment out this line.
apply from: "download-models.gradle"

Expand Down Expand Up @@ -101,4 +101,4 @@ dependencies {
implementation 'com.android.support:design:28.0.0'
implementation files('../../../jvm/core/target/tvm4j-core-0.0.1-SNAPSHOT.jar')
testImplementation 'junit:junit:4.13.2'
}
}
1 change: 0 additions & 1 deletion apps/android_deploy/app/download-models.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@ tasks.whenTaskAdded { task ->
task.dependsOn 'extractModels'
}
}

4 changes: 2 additions & 2 deletions apps/android_deploy/dev_tools/gen_keystore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions apps/android_deploy/dev_tools/sign_apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
2 changes: 1 addition & 1 deletion apps/android_deploy/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

org.gradle.jvmargs=-Xmx4096M
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions apps/android_rpc/dev_tools/gen_keystore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
4 changes: 2 additions & 2 deletions apps/android_rpc/dev_tools/sign_apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
6 changes: 3 additions & 3 deletions apps/bundle_deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ This will:
- Compile the model with Relay
- Build a `bundle.so` shared object containing the model specification and
parameters
- Build a `demo_dynamic` executable that `dlopen`'s `bundle.so` (or `bundle_c.so` in
- Build a `demo_dynamic` executable that `dlopen`'s `bundle.so` (or `bundle_c.so` in
terms of the MISRA-C runtime), instantiates the contained graph executor,
and invokes the `GraphExecutor::Run` function on a cat image, then prints
the output results.

Type the following command to run the sample code with static linking.

```bash
make demo_static
```
Expand All @@ -63,5 +63,5 @@ This will:
- Download the mobilenet0.25 model from the MXNet Gluon Model Zoo
- Compile the model with Relay and outputs `model.o`
- Build a `bundle_static.o` object containing the runtime functions
- Build a `demo_static` executable which has static link to `bundle_static.o` and
- Build a `demo_static` executable which has static link to `bundle_static.o` and
`model.o`, functions on a cat image, then prints the output results.
2 changes: 1 addition & 1 deletion apps/cpp_rpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ if(BUILD_STATIC_RUNTIME)
else()
list(APPEND TVM_RPC_LINKER_LIBS tvm_runtime)
endif()

target_link_libraries(tvm_rpc ${TVM_RPC_LINKER_LIBS})
1 change: 0 additions & 1 deletion apps/hexagon_launcher/cmake/hexagon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,3 @@ add_library(h_tvm_runtime STATIC IMPORTED)
set_target_properties(h_tvm_runtime PROPERTIES IMPORTED_LOCATION "${BINARY_DIR}/libtvm_runtime.a")

target_link_libraries(launcher_rpc_skel -Wl,--whole-archive h_tvm_runtime -Wl,--no-whole-archive)

1 change: 0 additions & 1 deletion apps/ios_rpc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rpc_config.txt

4 changes: 2 additions & 2 deletions apps/ios_rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ You can get value of your `team_id` in the following ways:
select target `tvmrpc`. At the bottom of this panel go to `Signing &
Capabilities` tab and in the field `Team` select your local developer profile
(`Your Name (Personal Team)`).

On the first run of the application you may see message `Could not launch
"tvmrpc"` in the XCode and message `Untrusted Developer` on your device. In
this case it will be necessary to check the certificate. Open
Expand Down Expand Up @@ -210,7 +210,7 @@ model and execute it on the target device. For this purpose we will use
```shell
python3 tests/ios_rpc_test.py --host <host_ip_address> --port 9190 --mode "tracker"
```
The output will be the same as in section
The output will be the same as in section
[Standalone RPC](#standalone-rpc).

## Communication without Wi-Fi and speed up in case of slow Wi-Fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@
"version" : 1,
"author" : "xcode"
}
}
}
2 changes: 0 additions & 2 deletions apps/microtvm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,3 @@ dependencies installed for running microTVM. To use it, run:
$ poetry lock && poetry install
$ poetry shell
```


2 changes: 1 addition & 1 deletion apps/microtvm/cmsisnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If the demo is run in the ci_cpu Docker container provided with TVM, then the fo
software will already be installed.

If the demo is not run in the ci_cpu Docker container, then you will need the following:
- Software required to build and run the demo (These can all be installed by running
- Software required to build and run the demo (These can all be installed by running
tvm/docker/install/ubuntu_install_ethosu_driver_stack.sh.)
- [Fixed Virtual Platform (FVP) based on Arm(R) Corstone(TM)-300 software](https://developer.arm.com/tools-and-software/open-source-software/arm-platforms-software/arm-ecosystem-fvps)
- [cmake 3.19.5](https://github.com/Kitware/CMake/releases/)
Expand Down
2 changes: 1 addition & 1 deletion apps/microtvm/cmsisnn/corstone300.ld
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ SECTIONS
*(.rodata.tvm)
. = ALIGN (16);
*(.data.tvm);
. = ALIGN(16);
. = ALIGN(16);
} > DDR

.text :
Expand Down
4 changes: 2 additions & 2 deletions apps/microtvm/reference-vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ For more information on how to use them, see the

Each RTOS or platform (like Zephyr, Ardunio, etc) that integrates with microTVM
can check-in installation scripts in the Reference VM in this directory to help
the community collaborate. You should use the tools provided here to ensure a
uniform release process across all platforms. Typically, releases need to be
the community collaborate. You should use the tools provided here to ensure a
uniform release process across all platforms. Typically, releases need to be
created by TVM committers.

Generally speaking, it's expected that any integrated platform with a regression
Expand Down
4 changes: 2 additions & 2 deletions apps/microtvm/reference-vm/base-box/base_box_provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# specific language governing permissions and limitations
# under the License.
#
# Using this script we can reuse docker/install scripts to configure the reference
# Using this script we can reuse docker/install scripts to configure the reference
# virtual machine similar to CI Cortex-M setup.
#

Expand All @@ -42,7 +42,7 @@ cd ~
sudo apt-get install -y ca-certificates

# Install Arduino-CLI (specific version)
# To keep in sync with the version
# To keep in sync with the version
# defined in apps/microtvm/arduino/template_project/microtvm_api_server.py
ARDUINO_CLI_VERSION="0.21.1"

Expand Down
1 change: 0 additions & 1 deletion apps/microtvm/zephyr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@
<!--- under the License. -->

This directory contains code to interface microTVM with the [Zephyr RTOS](https://zephyrproject.org/).

Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ ssize_t semihost_write(void* unused_context, const uint8_t* data, size_t size) {
write_req.size = size;
uint32_t ret_val = semihost_cmd(0x05, &write_req);
return size - ret_val;
}
}
18 changes: 9 additions & 9 deletions apps/microtvm/zephyr_cmsisnn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (NOT DEFINED CMSIS_PATH)
endif()

set(TVMC_COMMAND python3 -m tvm.driver.tvmc)
set(TVMC_ARGS
set(TVMC_ARGS
--target="cmsis-nn -mcpu=cortex-m55, c" # CMSIS-NN and C targets
--runtime=crt # C Runtime
--executor=aot # Ahead-of-Time Executor
Expand All @@ -41,14 +41,14 @@ set(TVM_RUNTIME
${CMAKE_CURRENT_BINARY_DIR}/runtime/src/runtime/crt/common/crt_backend_api.c
${CMAKE_CURRENT_BINARY_DIR}/runtime/src/runtime/crt/memory/stack_allocator.c
)
set(CODEGEN_OUTPUT
set(CODEGEN_OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/codegen/host/src/default_lib0.c
${CMAKE_CURRENT_BINARY_DIR}/codegen/host/src/default_lib1.c
${CMAKE_CURRENT_BINARY_DIR}/codegen/host/src/default_lib2.c
)
set(DATA_FILES
${CMAKE_CURRENT_BINARY_DIR}/inputs.c
${CMAKE_CURRENT_BINARY_DIR}/outputs.c
set(DATA_FILES
${CMAKE_CURRENT_BINARY_DIR}/inputs.c
${CMAKE_CURRENT_BINARY_DIR}/outputs.c
${CMAKE_CURRENT_BINARY_DIR}/labels.c
)
set(CMSIS_SOURCES
Expand All @@ -71,7 +71,7 @@ set(CMSIS_SOURCES

add_custom_command(
OUTPUT ${TVM_RUNTIME}
OUTPUT ${CODEGEN_OUTPUT}
OUTPUT ${CODEGEN_OUTPUT}
COMMAND ${TVMC_COMMAND} compile ${TVMC_ARGS} ${CMAKE_CURRENT_SOURCE_DIR}/model/cnn_s_quantized.tflite
COMMAND tar xf ${CMAKE_CURRENT_BINARY_DIR}/module.tar
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Expand All @@ -83,15 +83,15 @@ add_custom_command(
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

target_sources(app PRIVATE
target_sources(app PRIVATE
src/main.c
${TVM_RUNTIME}
${CODEGEN_OUTPUT}
${DATA_FILES}
${CMSIS_SOURCES}
)
target_include_directories(app
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
target_include_directories(app
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/runtime/include ${CMAKE_CURRENT_BINARY_DIR}/codegen/host/include
PUBLIC ${CMSIS_PATH}/CMSIS/NN/Include/ ${CMSIS_PATH}/CMSIS/DSP/Include
)
2 changes: 1 addition & 1 deletion apps/microtvm/zephyr_cmsisnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Download the keyword spotting model to the `model` directory:
wget \
https://github.com/ARM-software/ML-zoo/blob/ee35139af86bdace5e502b09fe8b9da9cb1f06bb/models/keyword_spotting/cnn_small/tflite_int8/cnn_s_quantized.tflite \
-O model/cnn_s_quantized.tflite
```
```

Checkout [CMSIS_5](https://github.com/ARM-software/CMSIS_5.git) (default is `/opt/arm/ethosu/cmsis` to reflect `tlcpack/ci_cortexm`):
```
Expand Down
2 changes: 1 addition & 1 deletion apps/microtvm/zephyr_cmsisnn/model/labels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ right
on
off
stop
go
go
2 changes: 1 addition & 1 deletion apps/microtvm/zephyr_cmsisnn/run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ west zephyr-export
west build
west build -t run &> ${LOGDIR}/west.log &

# Wait for "exit" keyword
# Wait for "exit" keyword
until grep -m 1 "exit" ${LOGDIR}/west.log; do sleep 1 ; done

# Check the log for correct output
Expand Down
5 changes: 2 additions & 3 deletions apps/pt_tvmdsoop/prepare_and_test_pt_tvm_class.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ echo "TVM_ROOT=${TVM_ROOT}"
export PYTHONPATH=${TVM_ROOT}/python

if [ ! -f $TVM_ROOT/build/libtvm.so ]; then
echo "$TVM_ROOT/build/libtvm.so missing"
echo "$TVM_ROOT/build/libtvm.so missing"
exit 1
fi

if [ ! -f $TVM_ROOT/build/libtvm_runtime.so ]; then
echo "$TVM_ROOT/build/libtvm_runtime.so missing"
echo "$TVM_ROOT/build/libtvm_runtime.so missing"
exit 1
fi

Expand All @@ -43,4 +43,3 @@ if [ "$?" -eq 0 ]; then

LD_LIBRARY_PATH=${TVM_ROOT}/build:./build:$LD_LIBRARY_PATH python3 -m pytest -v ./tests
fi

5 changes: 2 additions & 3 deletions apps/tf_tvmdsoop/prepare_and_test_tfop_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ echo "TVM_ROOT=${TVM_ROOT}"
export PYTHONPATH=${TVM_ROOT}/python

python3 -c "import tvm; print(tvm.runtime.enabled('gpu'))" | grep -e 1
if [ "$?" -eq 0 ]; then
if [ "$?" -eq 0 ]; then
echo "Build TF_TVMDSOOP with gpu support and execute tests"
CMAKE_OPTIONS="-DUSE_CUDA=ON -DPython3_EXECUTABLE=python3 -DTVM_ROOT=${TVM_ROOT}"

mkdir -p build
cd build; cmake .. ${CMAKE_OPTIONS} && make
cd ..

LD_LIBRARY_PATH=${TVM_ROOT}/build:./build:$LD_LIBRARY_PATH python3 -m pytest -v ./tests
fi

Loading

0 comments on commit a4840e7

Please sign in to comment.