Skip to content
Snippets Groups Projects
Unverified Commit 4780aae5 authored by Shenghang Tsai's avatar Shenghang Tsai Committed by GitHub
Browse files

Rm oneflow export and experimental (#5589)

* refine

* change abs.py for test

* refine

* refine

* refine

* refine

* refine

* refine

* add

* refeom

* refine

* refine

* refien

* refine

* refine

* refine

* refien

* add check

* refine

* refine

* refine

* skip license

* refine

* refien

* refine

* refien

* refien

* refine

* refine

* refine acos

* refien

* remove enable_eager_execution() in oneflow/python

remove @experimental_api decorator for apis, except that ones
having same name with single client api.

* remove all import oneflow.experimental in doctest

* replace oneflow.experimental with oneflow in docstr

* reformat

* auto format by CI

* refine

* refien

* refine

* refien

* refine

* refine

* refine

* refein

* refine

* remove signle client twice api

* refine

* refine

* refine

* refien

* refien

* refine

* refien

* refien

* refien

* refine

* r...
parent 89b5c21c
No related branches found
No related tags found
No related merge requests found
Showing
with 35 additions and 31 deletions
......@@ -27,7 +27,7 @@ jobs:
if: github.ref == 'refs/heads/master' || (github.event.pull_request.draft == false && contains(github.event.pull_request.requested_reviewers.*.login, 'oneflow-ci-bot') && contains(github.event.pull_request.labels.*.name, 'need-simple-ci'))
runs-on: ${{ matrix.os }}
needs: [cancel_previous]
timeout-minutes: 120
timeout-minutes: 240
strategy:
fail-fast: true
max-parallel: 3
......
......@@ -53,11 +53,13 @@ jobs:
id: license_check
run: |
python3 ci/check/run_license_format.py -i oneflow -c
python3 ci/check/run_license_format.py -i python -c
- name: Add license
id: license_fmt
if: ${{ failure() }}
run: |
python3 ci/check/run_license_format.py -i oneflow --fix
python3 ci/check/run_license_format.py -i python --fix
- name: Check C++/CUDA format
id: cpp_check
run: |
......@@ -521,7 +523,7 @@ jobs:
run: |
docker run \
${{ env.extra_docker_args }} ${{ env.pip_cache_docker_args }} \
-e ONEFLOW_TEST_DIR=$PWD/oneflow/python/test/modules \
-e ONEFLOW_TEST_DIR=$PWD/python/oneflow/test/modules \
${{ env.image_tag }} \
bash -c "python3 -m pip config set global.index-url ${{ env.pip_index_mirror }} && bash ci/test/try_install.sh && bash ci/test_multi_client/generic_test.sh"
- name: Dataloader API test
......@@ -530,7 +532,7 @@ jobs:
run: |
docker run \
${{ env.extra_docker_args }} ${{ env.pip_cache_docker_args }} \
-e ONEFLOW_TEST_DIR=$PWD/oneflow/python/test/dataloader \
-e ONEFLOW_TEST_DIR=$PWD/python/oneflow/test/dataloader \
${{ env.image_tag }} \
bash -c "python3 -m pip config set global.index-url ${{ env.pip_index_mirror }} && bash ci/test/try_install.sh && bash ci/test/generic_test.sh"
- name: Tensor API test
......@@ -539,7 +541,7 @@ jobs:
run: |
docker run \
${{ env.extra_docker_args }} ${{ env.pip_cache_docker_args }} \
-e ONEFLOW_TEST_DIR=$PWD/oneflow/python/test/tensor \
-e ONEFLOW_TEST_DIR=$PWD/python/oneflow/test/tensor \
${{ env.image_tag }} \
bash -c "python3 -m pip config set global.index-url ${{ env.pip_index_mirror }} && bash ci/test/try_install.sh && bash ci/test/generic_test.sh"
- name: Graph API test
......@@ -547,7 +549,7 @@ jobs:
run: |
docker run \
${{ env.extra_docker_args }} ${{ env.pip_cache_docker_args }} \
-e ONEFLOW_TEST_DIR=$PWD/oneflow/python/test/graph \
-e ONEFLOW_TEST_DIR=$PWD/python/oneflow/test/graph \
${{ env.image_tag }} \
bash -c "python3 -m pip config set global.index-url ${{ env.pip_index_mirror }} && bash ci/test/try_install.sh && bash ci/test/generic_test.sh"
- name: Checkout Oneflow-Inc/models
......@@ -555,7 +557,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: Oneflow-Inc/models
ref: 830a6b91f10c0a04a68843370cea6319a21ed9c2
ref: c822b17f9ed598185cf1fa70f570871d12db7442
path: oneflow-models
- name: Speed test
id: speed
......
......@@ -31,4 +31,4 @@ compile_commands.json
/distributed-tmp
/serving-tmp
test_tmp_dir
oneflow/python/version.py
unittest-log-*
......@@ -105,8 +105,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(THIRD_PARTY_DIR "${PROJECT_BINARY_DIR}/third_party_install"
CACHE PATH "Where to install third party headers and libs")
set(THIRD_PARTY_SUBMODULE_DIR "${PROJECT_SOURCE_DIR}/build/third_party"
CACHE PATH "Where the third party submodules are")
set(ONEFLOW_PYTHON_DIR "${PROJECT_SOURCE_DIR}/python" CACHE PATH "oneflow python src dir")
if(WIN32)
set(CMAKE_BUILD_TYPE Debug)
......
......@@ -3,7 +3,7 @@
**OneFlow is a performance-centered and open-source deep learning framework.**
[![Simple CI](https://github.com/Oneflow-Inc/oneflow/actions/workflows/simple.yml/badge.svg)](https://github.com/Oneflow-Inc/oneflow/actions/workflows/simple.yml)
[![Documentation Status](https://readthedocs.org/projects/oneflow/badge/?version=master)](https://oneflow.readthedocs.io/en/master/?badge=master)
## Latest News
- Version 0.4.0 is out!
- New Pytorch flavored APIs (`import oneflow.experimental as flow`)
......
......@@ -85,6 +85,7 @@ if __name__ == "__main__":
parser.add_argument(
"-v", "--verbose", default=False, action="store_true", required=False
)
parser.add_argument("--silent", default=False, action="store_true", required=False)
parser.add_argument(
"-c", "--check", default=False, action="store_true", required=False
)
......@@ -109,4 +110,5 @@ if __name__ == "__main__":
if args.verbose:
print("license already added:", p)
else:
print("license just added:", p)
if args.silent == False:
print("license just added:", p)
set -xe
rm -rf /benchmarks
cp -r oneflow/compatible_single_client_python/benchmarks /benchmarks
cp -r python/oneflow/compatible/single_client/benchmarks /benchmarks
cd /benchmarks
python3 cnn_benchmark/of_cnn_benchmarks.py \
......@@ -42,7 +42,7 @@ python3 cnn_benchmark/of_cnn_benchmarks.py \
--iter_num=5 \
--learning_rate=0.01 \
--optimizer="sgd" \
--loss_print_every_n_iter=1
--loss_print_every_n_iter=1
python3 bert_benchmark/run_pretraining.py \
--gpu_num_per_node=1 \
......
set -ex
rm -rf /benchmarks
cp -r oneflow/compatible_single_client_python/benchmarks /benchmarks
cp -r python/oneflow/compatible/single_client/benchmarks /benchmarks
cd /benchmarks
python3 cnn_benchmark/of_cnn_benchmarks.py \
......
......@@ -3,11 +3,11 @@
set -xe
src_dir=${ONEFLOW_SRC_DIR:-"$PWD"}
test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"/test_tmp_dir"}
test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"./test_tmp_dir"}
rm -rf $test_tmp_dir
mkdir -p $test_tmp_dir
cp -r $src_dir/oneflow/compatible_single_client_python/test/custom_ops $test_tmp_dir
cp -r $src_dir/python/oneflow/compatible/single_client/test/custom_ops $test_tmp_dir
cd $test_tmp_dir
export ONEFLOW_TEST_DEVICE_NUM=1
......
#!/bin/bash
set -xe
cp -r oneflow/python/test /test_dir
cp -r python/oneflow/test /test_dir
cd /test_dir
python3 models/eager_1node_test.py
......@@ -6,7 +6,7 @@ test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"/test_tmp_dir"}
rm -rf $test_tmp_dir
mkdir -p $test_tmp_dir
cp -r $src_dir/oneflow/compatible_single_client_python/test $test_tmp_dir
cp -r $src_dir/python/oneflow/compatible/single_client/test $test_tmp_dir
cd $test_tmp_dir
export ONEFLOW_TEST_DEVICE_NUM=1
......
#!/bin/bash
set -xe
cp -r oneflow/compatible_single_client_python/test /test_dir
cp -r python/oneflow/compatible/single_client/test /test_dir
cd /test_dir
python3 models/1node_test.py
......@@ -10,7 +10,7 @@ test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"./test_tmp_dir"}
rm -rf $test_tmp_dir
mkdir -p $test_tmp_dir
cp -r $src_dir/oneflow/compatible_single_client_python/test $test_tmp_dir
cp -r $src_dir/python/oneflow/compatible/single_client/test $test_tmp_dir
cd $test_tmp_dir
python3 -m oneflow --doctor
......
......@@ -10,7 +10,7 @@ test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"/test_tmp_dir"}
rm -rf $test_tmp_dir
mkdir -p $test_tmp_dir
chmod -R o+w $test_tmp_dir
cp -r $src_dir/oneflow/compatible_single_client_python/test $test_tmp_dir
cp -r $src_dir/python/oneflow/compatible/single_client/test $test_tmp_dir
cd $test_tmp_dir
ONEFLOW_TEST_DEVICE_NUM=1 python3 test/ops/test_assign.py --failfast --verbose
......
......@@ -11,7 +11,7 @@ python3 -c 'import oneflow; f=open("oneflow_path.txt", "w"); f.write(oneflow.__p
gpu_num=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l)
python3 $src_dir/ci/test/parallel_run.py \
--gpu_num=${gpu_num} \
--dir=$(cat oneflow_path.txt)/python \
--dir=$(cat oneflow_path.txt) \
--timeout=1 \
--verbose \
--chunk=1 \
......
......@@ -9,7 +9,7 @@ test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"./test_tmp_dir"}
rm -rf $test_tmp_dir
mkdir -p $test_tmp_dir
cp -r $src_dir/oneflow/compatible_single_client_python/benchmarks $test_tmp_dir
cp -r $src_dir/python/oneflow/compatible/single_client/benchmarks $test_tmp_dir
cd $test_tmp_dir/benchmarks
export ONEFLOW_DRY_RUN=1
......
......@@ -5,9 +5,9 @@ export TF_CPP_MIN_LOG_LEVEL=3
export PYTHONUNBUFFERED=1
src_dir=${ONEFLOW_SRC_DIR:-"$PWD"}
test_dir=${ONEFLOW_TEST_DIR:-"$PWD/oneflow/python/test/ops"}
test_dir=${ONEFLOW_TEST_DIR:-"$PWD/python/oneflow/test/ops"}
test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"./test_tmp_dir"}
export ONEFLOW_TEST_UTILS_DIR=$src_dir/oneflow/python/test_utils
export ONEFLOW_TEST_UTILS_DIR=$src_dir/python/oneflow/test_utils
rm -rf $test_tmp_dir
mkdir -p $test_tmp_dir
......
......@@ -13,13 +13,14 @@ import uuid
def gen_cmds(cmd=None, dir=None, doctest=False):
if doctest:
paths = glob.glob(os.path.join(dir, "**/*.py"), recursive=True)
print(paths)
paths = [p for p in paths if "compatible" not in p and "single_client" not in p]
with_doctest = []
for p in paths:
with open(p) as f:
content = f.read()
if "doctest" in content and "__" not in p:
if "doctest" in content:
with_doctest.append("{} {} -v".format(cmd, p))
print(with_doctest)
return with_doctest
else:
paths = glob.glob(os.path.join(dir, "test_*.py"), recursive=False)
......
......@@ -5,7 +5,7 @@ test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"/test_tmp_dir"}
rm -rf $test_tmp_dir
mkdir -p $test_tmp_dir
cp -r $src_dir/oneflow/compatible_single_client_python/test/xrt $test_tmp_dir
cp -r $src_dir/python/oneflow/compatible/single_client/test/xrt $test_tmp_dir
cd $test_tmp_dir
python3 -c "import oneflow.compatible.single_client as flow; assert flow.sysconfig.with_xla()"
for f in $src_dir/oneflow/compatible_single_client_python/test/xrt/*.py; do python3 "$f"; done
for f in $src_dir/python/oneflow/compatible/single_client/test/xrt/*.py; do python3 "$f"; done
......@@ -4,9 +4,9 @@ set -xe
export PYTHONUNBUFFERED=1
src_dir=${ONEFLOW_SRC_DIR:-"$PWD"}
test_dir=${ONEFLOW_TEST_DIR:-"$PWD/oneflow/python/test/modules"}
test_dir=${ONEFLOW_TEST_DIR:-"$PWD/python/oneflow/test/modules"}
test_tmp_dir=${ONEFLOW_TEST_TMP_DIR:-"./test_tmp_dir"}
export ONEFLOW_TEST_UTILS_DIR=$src_dir/oneflow/python/test_utils
export ONEFLOW_TEST_UTILS_DIR=$src_dir/python/oneflow/test_utils
rm -rf $test_tmp_dir
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment