Skip to content

Commit

Permalink
Rename ml.dmlc.tvm to org.apache.tvm (#4290)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhliu authored and tqchen committed Nov 10, 2019
1 parent d64bf6b commit 1dcf8a1
Show file tree
Hide file tree
Showing 74 changed files with 217 additions and 205 deletions.
6 changes: 3 additions & 3 deletions apps/android_deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This folder contains Android Demo app that allows us to show how to deploy model

You will need [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), [Android SDK](https://developer.android.com/studio/index.html), [Android NDK](https://developer.android.com/ndk) and an Android device to use this. Make sure the `ANDROID_HOME` variable already points to your Android SDK folder or set it using `export ANDROID_HOME=[Path to your Android SDK, e.g., ~/Android/sdk]`. We use [Gradle](https://gradle.org) to build. Please follow [the installation instruction](https://gradle.org/install) for your operating system.

Alternatively, you may execute Docker image we provide wich contains the required packages. Use the command below to build the image and enter interactive session. Note, that building with OpenCL was not tested from Docker.
Alternatively, you may execute Docker image we provide which contains the required packages. Use the command below to build the image and enter interactive session. Note, that building with OpenCL was not tested from Docker.

```bash
./docker/build.sh demo_android -it bash
Expand All @@ -45,7 +45,7 @@ dependencies {
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
compile 'ml.dmlc.tvm:tvm4j-core:0.0.1-SNAPSHOT'
compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
testCompile 'junit:junit:4.12'
}
```
Expand Down Expand Up @@ -124,7 +124,7 @@ If everything goes well, you will find compile tools in `/opt/android-toolchain-

Follow instruction to get compiled version model for android target [here.](http://docs.tvm.ai/deploy/android.html)

Copied these compiled model deploy_lib.so, deploy_graph.json and deploy_param.params to apps/android_deploy/app/src/main/assets/ and modify TVM flavor changes on [java](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java#L81)
Copied these compiled model deploy_lib.so, deploy_graph.json and deploy_param.params to apps/android_deploy/app/src/main/assets/ and modify TVM flavor changes on [java](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java#L81)

`CPU Verison flavor`
```
Expand Down
4 changes: 2 additions & 2 deletions apps/android_deploy/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "ml.dmlc.tvm.android.demo"
applicationId "org.apache.tvm.android.demo"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
Expand Down Expand Up @@ -68,6 +68,6 @@ dependencies {
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
compile 'ml.dmlc.tvm:tvm4j-core:0.0.1-SNAPSHOT'
compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
testCompile 'junit:junit:4.12'
}
4 changes: 2 additions & 2 deletions apps/android_deploy/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ml.dmlc.tvm.android.demo" >
package="org.apache.tvm.android.demo" >

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Expand All @@ -32,7 +32,7 @@ under the License.
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:name="org.apache.tvm.android.demo.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package ml.dmlc.tvm.android.demo;
package org.apache.tvm.android.demo;

import android.Manifest;
import android.content.Intent;
Expand Down Expand Up @@ -53,12 +53,12 @@
import java.util.Date;
import java.util.Vector;

import ml.dmlc.tvm.Function;
import ml.dmlc.tvm.Module;
import ml.dmlc.tvm.NDArray;
import ml.dmlc.tvm.TVMContext;
import ml.dmlc.tvm.TVMValue;
import ml.dmlc.tvm.TVMType;
import org.apache.tvm.Function;
import org.apache.tvm.Module;
import org.apache.tvm.NDArray;
import org.apache.tvm.TVMContext;
import org.apache.tvm.TVMValue;
import org.apache.tvm.TVMType;

public class MainActivity extends AppCompatActivity {
private static final String TAG = MainActivity.class.getSimpleName();
Expand Down
2 changes: 1 addition & 1 deletion apps/android_deploy/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif

include $(config)

LOCAL_SRC_FILES := ml_dmlc_tvm_native_c_api.cc
LOCAL_SRC_FILES := org_apache_tvm_native_c_api.cc
LOCAL_LDFLAGS := -L$(SYSROOT)/usr/lib/ -llog

LOCAL_C_INCLUDES := $(ROOT_PATH)/include \
Expand Down
4 changes: 2 additions & 2 deletions apps/android_deploy/app/src/main/jni/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
PATH="$PATH:/usr/local/bin"
CURR_DIR=$(cd `dirname $0`; pwd)
ROOT_DIR="$CURR_DIR/../../../../../.."
javah -o $CURR_DIR/ml_dmlc_tvm_native_c_api.h -cp "$ROOT_DIR/jvm/core/target/*" ml.dmlc.tvm.LibInfo || exit -1
cp -f $ROOT_DIR/jvm/native/src/main/native/ml_dmlc_tvm_native_c_api.cc $CURR_DIR/ || exit -1
javah -o $CURR_DIR/org_apache_tvm_native_c_api.h -cp "$ROOT_DIR/jvm/core/target/*" org.apache.tvm.LibInfo || exit -1
cp -f $ROOT_DIR/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc $CURR_DIR/ || exit -1
cp -f $ROOT_DIR/jvm/native/src/main/native/jni_helper_func.h $CURR_DIR/ || exit -1
rm -rf $CURR_DIR/../libs
ndk-build --directory=$CURR_DIR
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ under the License.
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ml.dmlc.tvm.android.demo.MainActivity">
tools:context="org.apache.tvm.android.demo.MainActivity">

<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
Expand Down
18 changes: 18 additions & 0 deletions apps/android_deploy/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# 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
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

org.gradle.jvmargs=-Xmx4096M
6 changes: 3 additions & 3 deletions apps/android_rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
compile 'ml.dmlc.tvm:tvm4j-core:0.0.1-SNAPSHOT'
compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
testCompile 'junit:junit:4.12'
}
```
Expand All @@ -64,12 +64,12 @@ If you see error:

adb: failed to install app/build/outputs/apk/release/tvmrpc-release.apk:
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE:
Package ml.dmlc.tvm.tvmrpc signatures do not match the previously installed version; ignoring!]
Package org.apache.tvm.tvmrpc signatures do not match the previously installed version; ignoring!]

Run uninstall first:

```bash
$ANDROID_HOME/platform-tools/adb uninstall ml.dmlc.tvm.tvmrpc
$ANDROID_HOME/platform-tools/adb uninstall org.apache.tvm.tvmrpc
```

### Build with OpenCL
Expand Down
4 changes: 2 additions & 2 deletions apps/android_rpc/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "ml.dmlc.tvm.tvmrpc"
applicationId "org.apache.tvm.tvmrpc"
minSdkVersion 24
targetSdkVersion 26
versionCode 1
Expand Down Expand Up @@ -58,6 +58,6 @@ dependencies {
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
compile 'ml.dmlc.tvm:tvm4j-core:0.0.1-SNAPSHOT'
compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
testCompile 'junit:junit:4.12'
}
2 changes: 1 addition & 1 deletion apps/android_rpc/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ml.dmlc.tvm.tvmrpc" >
package="org.apache.tvm.tvmrpc" >

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,21 @@
* limitations under the License.
*/

package ml.dmlc.tvm.tvmrpc;
package org.apache.tvm.tvmrpc;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.Button;
import android.view.View;
import android.content.Intent;
import android.app.NotificationChannel;
import android.app.NotificationManager;


public class MainActivity extends AppCompatActivity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package ml.dmlc.tvm.tvmrpc;
package org.apache.tvm.tvmrpc;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
* limitations under the License.
*/

package ml.dmlc.tvm.tvmrpc;
package org.apache.tvm.tvmrpc;

import android.os.ParcelFileDescriptor;
import java.net.Socket;
import ml.dmlc.tvm.rpc.ConnectTrackerServerProcessor;
import ml.dmlc.tvm.rpc.RPCWatchdog;
import org.apache.tvm.rpc.ConnectTrackerServerProcessor;
import org.apache.tvm.rpc.RPCWatchdog;

/**
* Connect to RPC proxy and deal with requests.
Expand Down
2 changes: 1 addition & 1 deletion apps/android_rpc/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif

include $(config)

LOCAL_SRC_FILES := ml_dmlc_tvm_native_c_api.cc
LOCAL_SRC_FILES := org_apache_tvm_native_c_api.cc
LOCAL_LDFLAGS := -L$(SYSROOT)/usr/lib/ -llog

LOCAL_C_INCLUDES := $(ROOT_PATH)/include \
Expand Down
4 changes: 2 additions & 2 deletions apps/android_rpc/app/src/main/jni/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
PATH="$PATH:/usr/local/bin"
CURR_DIR=$(cd `dirname $0`; pwd)
ROOT_DIR="$CURR_DIR/../../../../../.."
javah -o $CURR_DIR/ml_dmlc_tvm_native_c_api.h -cp "$ROOT_DIR/jvm/core/target/*" ml.dmlc.tvm.LibInfo || exit -1
cp -f $ROOT_DIR/jvm/native/src/main/native/ml_dmlc_tvm_native_c_api.cc $CURR_DIR/ || exit -1
javah -o $CURR_DIR/org_apache_tvm_native_c_api.h -cp "$ROOT_DIR/jvm/core/target/*" org.apache.tvm.LibInfo || exit -1
cp -f $ROOT_DIR/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc $CURR_DIR/ || exit -1
cp -f $ROOT_DIR/jvm/native/src/main/native/jni_helper_func.h $CURR_DIR/ || exit -1
rm -rf $CURR_DIR/../libs
ndk-build --directory=$CURR_DIR
2 changes: 1 addition & 1 deletion apps/android_rpc/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ under the License.
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ml.dmlc.tvm.tvmrpc.MainActivity">
tools:context="org.apache.tvm.tvmrpc.MainActivity">

<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion apps/android_rpc/app/src/main/res/layout/activity_rpc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ under the License.
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="ml.dmlc.tvm.tvmrpc.RPCActivity">
tools:context="org.apache.tvm.tvmrpc.RPCActivity">

<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion apps/ios_rpc/init_proj.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import re

default_team_id = "3FR42MXLK9"
default_bundle_identifier = 'ml.dmlc.tvmrpc'
default_bundle_identifier = 'org.apache.tvmrpc'

parser = argparse.ArgumentParser(description='Update tvmrpc.xcodeproj\
developer information')
Expand Down
8 changes: 4 additions & 4 deletions apps/ios_rpc/tvmrpc.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@
);
INFOPLIST_FILE = tvmrpc/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = ml.dmlc.tvmrpc;
PRODUCT_BUNDLE_IDENTIFIER = org.apache.tvmrpc;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -411,7 +411,7 @@
);
INFOPLIST_FILE = tvmrpc/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = ml.dmlc.tvmrpc;
PRODUCT_BUNDLE_IDENTIFIER = org.apache.tvmrpc;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand All @@ -428,7 +428,7 @@
);
INFOPLIST_FILE = tvmrpcLauncher/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = ml.dmlc.tvmrpcLauncher;
PRODUCT_BUNDLE_IDENTIFIER = org.apache.tvmrpcLauncher;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tvmrpc.app/tvmrpc";
};
Expand All @@ -446,7 +446,7 @@
);
INFOPLIST_FILE = tvmrpcLauncher/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = ml.dmlc.tvmrpcLauncher;
PRODUCT_BUNDLE_IDENTIFIER = org.apache.tvmrpcLauncher;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tvmrpc.app/tvmrpc";
};
Expand Down
2 changes: 1 addition & 1 deletion docs/deploy/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ deploy_lib.so, deploy_graph.json, deploy_param.params will go to android target.
## TVM Runtime for Android Target

Refer [here](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/README.md#build-and-installation) to build CPU/OpenCL version flavor TVM runtime for android target.
From android java TVM API to load model & execute can be referred at this [java](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java) sample source.
From android java TVM API to load model & execute can be referred at this [java](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java) sample source.
8 changes: 4 additions & 4 deletions jvm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ if __name__ == "__main__":
The following code snippet demonstrate how to load generated shared library (add_cpu.so).

```java
import ml.dmlc.tvm.Module;
import ml.dmlc.tvm.NDArray;
import ml.dmlc.tvm.TVMContext;
import org.apache.tvm.Module;
import org.apache.tvm.NDArray;
import org.apache.tvm.TVMContext;

import java.io.File;
import java.util.Arrays;
Expand Down Expand Up @@ -175,4 +175,4 @@ Server server = new Server(proxyHost, proxyPort, "key");
server.start();
```

You can also use `StandaloneServerProcessor` and `ConnectProxyServerProcessor` to build your own RPC server. Refer to [Android RPC Server](https://github.com/apache/incubator-tvm/blob/master/apps/android_rpc/app/src/main/java/ml/dmlc/tvm/tvmrpc/RPCProcessor.java) for more details.
You can also use `StandaloneServerProcessor` and `ConnectProxyServerProcessor` to build your own RPC server. Refer to [Android RPC Server](https://github.com/apache/incubator-tvm/blob/master/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/RPCProcessor.java) for more details.
8 changes: 4 additions & 4 deletions jvm/assembly/linux-x86_64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ under the License.
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ml.dmlc.tvm</groupId>
<groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-full-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>ml.dmlc.tvm</groupId>
<groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-full-linux-x86_64</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>TVM4J Package - Full Linux-x86_64</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>ml.dmlc.tvm</groupId>
<groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ml.dmlc.tvm</groupId>
<groupId>org.apache.tvm</groupId>
<artifactId>libtvm4j-linux-x86_64</artifactId>
<version>${project.version}</version>
<type>so</type>
Expand Down
2 changes: 1 addition & 1 deletion jvm/assembly/linux-x86_64/src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ under the License.
<useProjectArtifact>false</useProjectArtifact>
<useStrictFiltering>false</useStrictFiltering>
<includes>
<include>ml.dmlc.tvm:libtvm4j-linux-x86_64:so</include>
<include>org.apache.tvm:libtvm4j-linux-x86_64:so</include>
</includes>
</dependencySet>
</dependencySets>
Expand Down
Loading

0 comments on commit 1dcf8a1

Please sign in to comment.