You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ha...@apache.org on 2020/03/13 03:24:06 UTC

[incubator-tvm] branch master updated: [DOCS] Move git_howto to rst, add Stage documents to te (#5055)

This is an automated email from the ASF dual-hosted git repository.

haichen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/master by this push:
     new 64bc997  [DOCS] Move git_howto to rst, add Stage documents to te (#5055)
64bc997 is described below

commit 64bc9978e17a2687f647a74f6136a1431390924e
Author: Tianqi Chen <tq...@users.noreply.github.com>
AuthorDate: Thu Mar 12 20:23:56 2020 -0700

    [DOCS] Move git_howto to rst, add Stage documents to te (#5055)
---
 docs/contribute/git_howto.md  |  74 -----------------------
 docs/contribute/git_howto.rst | 137 ++++++++++++++++++++++++++++++++++++++++++
 python/tvm/te/__init__.py     |   2 +-
 3 files changed, 138 insertions(+), 75 deletions(-)

diff --git a/docs/contribute/git_howto.md b/docs/contribute/git_howto.md
deleted file mode 100644
index 725ed0b..0000000
--- a/docs/contribute/git_howto.md
+++ /dev/null
@@ -1,74 +0,0 @@
-<!--- 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. -->
-
-# Git Usage Tips
-
-Here are some tips for git workflow.
-
-## How to resolve conflict with master
-- First rebase to most recent master
-```bash
-# The first two steps can be skipped after you do it once.
-git remote add upstream [url to tvm repo]
-git fetch upstream
-git rebase upstream/master
-```
-- The git may show some conflicts it cannot merge, say ```conflicted.py```.
-  - Manually modify the file to resolve the conflict.
-  - After you resolved the conflict, mark it as resolved by
-```bash
-git add conflicted.py
-```
-- Then you can continue rebase by
-```bash
-git rebase --continue
-```
-- Finally push to your fork, you may need to force push here.
-```bash
-git push --force
-```
-
-## How to combine multiple commits into one
-Sometimes we want to combine multiple commits, especially when later commits are only fixes to previous ones,
-to create a PR with set of meaningful commits. You can do it by following steps.
-- Before doing so, configure the default editor of git if you haven't done so before.
-```bash
-git config core.editor the-editor-you-like
-```
-- Assume we want to merge last 3 commits, type the following commands
-```bash
-git rebase -i HEAD~3
-```
-- It will pop up an text editor. Set the first commit as ```pick```, and change later ones to ```squash```.
-- After you saved the file, it will pop up another text editor to ask you modify the combined commit message.
-- Push the changes to your fork, you need to force push.
-```bash
-git push --force
-```
-
-## Reset to the most recent master
-You can always use git reset to reset your version to the most recent master.
-Note that all your ***local changes will get lost***.
-So only do it when you do not have local changes or when your pull request just get merged.
-```bash
-git reset --hard [hash tag of master]
-git push --force
-```
-
-## What is the consequence of force push
-The previous two tips requires force push, this is because we altered the path of the commits.
-It is fine to force push to your own fork, as long as the commits changed are only yours.
diff --git a/docs/contribute/git_howto.rst b/docs/contribute/git_howto.rst
new file mode 100644
index 0000000..6bb0399
--- /dev/null
+++ b/docs/contribute/git_howto.rst
@@ -0,0 +1,137 @@
+..  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.
+
+.. _git-howto:
+
+
+Git Usage Tips
+==============
+
+Here are some tips for git workflow.
+
+## How to resolve conflict with master
+
+- First rebase to most recent master
+
+.. code:: bash
+
+  # The first two steps can be skipped after you do it once.
+  git remote add upstream [url to tvm repo]
+  git fetch upstream
+  git rebase upstream/master
+
+
+- The git may show some conflicts it cannot merge, say `conflicted.py`.
+
+  - Manually modify the file to resolve the conflict.
+  - After you resolved the conflict, mark it as resolved by
+
+.. code:: bash
+
+  git add conflicted.py
+
+- Then you can continue rebase by
+
+.. code:: bash
+
+  git rebase --continue
+
+- Finally push to your fork, you may need to force push here.
+
+.. code:: bash
+
+  git push --force
+
+
+How to combine multiple commits into one
+----------------------------------------
+
+Sometimes we want to combine multiple commits, especially when later commits are only fixes to previous ones,
+to create a PR with set of meaningful commits. You can do it by following steps.
+
+- Before doing so, configure the default editor of git if you haven't done so before.
+
+.. code:: bash
+
+  git config core.editor the-editor-you-like
+
+- Assume we want to merge last 3 commits, type the following commands
+
+.. code:: bash
+
+  git rebase -i HEAD~3
+
+- It will pop up an text editor. Set the first commit as `pick`, and change later ones to `squash`.
+- After you saved the file, it will pop up another text editor to ask you modify the combined commit message.
+- Push the changes to your fork, you need to force push.
+
+.. code:: bash
+
+  git push --force
+
+
+Reset to the most recent master
+-------------------------------
+
+You can always use git reset to reset your version to the most recent master.
+Note that all your ***local changes will get lost***.
+So only do it when you do not have local changes or when your pull request just get merged.
+
+.. code:: bash
+
+  git reset --hard [hash tag of master]
+
+
+Recover a Previous Commit after Reset
+-------------------------------------
+Sometimes we could mistakenly reset a branch to a wrong commit.
+When that happens, you can use the following command to show the list
+of recent commits
+
+.. code:: bash
+
+   git reflog
+
+Once you get the right hashtag, you can use git reset again to change
+the head to the right commit.
+
+
+Apply only k-Latest Commits on to the master
+--------------------------------------------
+
+Sometimes it is useful to only apply your k-latest changes on top of the master.
+This usually happens when you have other m-commits that are already merged
+before these k-commits. Directly rebase against the master might cause merge conflicts
+on these first m-commits(which are can be safely discarded).
+
+You can instead use the following command
+
+.. code:: bash
+
+  # k is the concrete number
+  # Put HEAD~2 for the last 1 commit.
+  git rebase --onto upstream/master HEAD~k
+
+You can then force push to the master. Note that the above command will discard
+all the commits before tha last k ones.
+
+
+What is the consequence of force push
+-------------------------------------
+
+The previous two tips requires force push, this is because we altered the path of the commits.
+It is fine to force push to your own fork, as long as the commits changed are only yours.
diff --git a/python/tvm/te/__init__.py b/python/tvm/te/__init__.py
index 3a1a124..83cd189 100644
--- a/python/tvm/te/__init__.py
+++ b/python/tvm/te/__init__.py
@@ -24,7 +24,7 @@ from tvm.tir import trunc, abs, round, nearbyint, isnan, power, popcount, fmod,
 from tvm.tir import div, indexdiv, indexmod, truncdiv, truncmod, floordiv, floormod
 from tvm.tir import comm_reducer, min, max, sum
 
-from .schedule import Schedule, create_schedule, SpecializedCondition
+from .schedule import Schedule, Stage, create_schedule, SpecializedCondition
 from .tensor import TensorSlice, Tensor
 from .tensor_intrin import decl_tensor_intrin
 from .tag import tag_scope