Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[installation] copy the *.so files into Python package path #377

Closed
fivejjs opened this issue Aug 24, 2017 · 4 comments
Closed

[installation] copy the *.so files into Python package path #377

fivejjs opened this issue Aug 24, 2017 · 4 comments

Comments

@fivejjs
Copy link

fivejjs commented Aug 24, 2017

When I install tvm Python as:

cd python; python setup.py install 

I failed import tvm before I manually copied the *.so files into the package path.

@ysh329
Copy link
Contributor

ysh329 commented Aug 24, 2017

Can you give more detailed information, such as platform info., X86 or embedded device? or any failed logs?

There's an installation guide, which can guide you install TVM on local machine. Besides, another link can guide you use cross-compilation.

With cross compilation and RPC, you can compile program on your local machine then run
it on remote device. It is useful when the resource of remote device is limited, like
Raspberry Pi and mobile platforms, so you do not wish to put the compilation procedure
on the device in order to save time and space.

@fivejjs
Copy link
Author

fivejjs commented Aug 24, 2017

On X86 ubuntu 16.04. tvm compiled successfully and Python (3.5) module installed fine but run the following line in Ipython environment failed:

import tvm
....
RuntimeError: Cannot find the files.
List of candidates:
/usr/local/cuda/lib64/libtvm.so
/usr/local/cuda/extras/CUPTI/lib64/libtvm.so
/usr/lib/jvm/default-java/jre/lib/amd64/server/libtvm.so
/usr/local/cuda/lib64/libtvm.so
/usr/local/cuda/extras/CUPTI/lib64/libtvm.so
/usr/lib/jvm/default-java/jre/lib/amd64/server/libtvm.so
/home/xxx/libtvm.so
/home/xxx/anaconda3/lib/python3.5/site-packages/tvm-0.1.0-py3.5-linux-x86_64.egg/tvm/libtvm.so
/home/xxx/anaconda3/lib/python3.5/site-packages/build/libtvm.so
/home/xxx/anaconda3/lib/python3.5/site-packages/build/Release/libtvm.so
/home/xxx/anaconda3/lib/python3.5/site-packages/lib/libtvm.so
/home/xxx/anaconda3/lib/python3.5/libtvm.so
/usr/local/cuda/lib64/libtvm_runtime.so
/usr/local/cuda/extras/CUPTI/lib64/libtvm_runtime.so
/usr/lib/jvm/default-java/jre/lib/amd64/server/libtvm_runtime.so
/usr/local/cuda/lib64/libtvm_runtime.so
/usr/local/cuda/extras/CUPTI/lib64/libtvm_runtime.so
/usr/lib/jvm/default-java/jre/lib/amd64/server/libtvm_runtime.so
/home/xxx/libtvm_runtime.so
/home/xxx/anaconda3/lib/python3.5/site-packages/tvm-0.1.0-py3.5-linux-x86_64.egg/tvm/libtvm_runtime.so
/home/xxx/anaconda3/lib/python3.5/site-packages/build/libtvm_runtime.so
/home/xxx/anaconda3/lib/python3.5/site-packages/build/Release/libtvm_runtime.so
/home/xxx/anaconda3/lib/python3.5/site-packages/lib/libtvm_runtime.so
/home/xxx/anaconda3/lib/python3.5/libtvm_runtime.so

After manually copied the files in
"tvm/lib"
into folder:
"/home/jjs/anaconda3/lib/python3.5/site-packages/tvm-0.1.0-py3.5-linux-x86_64.egg/tvm/"
, I can use tvm Python API now at least.

@ysh329
Copy link
Contributor

ysh329 commented Aug 24, 2017

@fivejjs I'm not sure whether this problem is about environment varibles, but you can have a try to export relative environment variable to ~/.bashrc as below (set yourself TVM_HOME value):

# add tvm
export TVM_HOME=~/Software/tvm
export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}

After that, enable updated ~/.bashrc using source ~/.bashrc.

Sent from my Meizu m1 metal using FastHub

@tqchen
Copy link
Member

tqchen commented Aug 24, 2017

Thanks for reporting this! It should be fixed by #380

@tqchen tqchen closed this as completed Aug 25, 2017
tqchen pushed a commit to tqchen/tvm that referenced this issue May 26, 2018
tqchen pushed a commit to tqchen/tvm that referenced this issue Jul 6, 2018
sergei-mironov pushed a commit to sergei-mironov/tvm that referenced this issue Aug 8, 2018
junrushao pushed a commit to junrushao/tvm that referenced this issue Feb 8, 2023
This PR is the kickoff action of our switch towards `sinfo_args` in
CallNode, as discussed in apache#356 and tracked by apache#377.

* CallNode field `type_args` is changed to `sinfo_args`, with type
`Array<StructInfo>`.

* For intrinsic ops like `call_tir`/`call_packed`, this PR keeps the
`sinfo_args` value as **the plain StructInfo generated from the static
type**, even if those op calls were provided with richer StructInfo at
the time of creation. The API changes, creations and structure info
deductions of these intrinsic ops will be left to the next PR, as the
tracking issue apache#377. Since that PR, our APIs and structure info
deductions of these ops will no longer rely on types.
junrushao pushed a commit to junrushao/tvm that referenced this issue Feb 8, 2023
This PR is part of the `sinfo_args` switch, as tracked by apache#377.

This PR removes VisitType from ExprFunctor in Relax, as Type is no
longer a standalone construct in any Relax AST, with the switch of
`sinfo_args` introduced by apache#379.
junrushao pushed a commit to junrushao/tvm that referenced this issue Feb 8, 2023
… etc. (apache#386)

* [Refactor][AST] `sinfo_args` A1: Update API of call_tir, call_packed, etc

Following apache#377 and apache#379, this PR followups to update the API of `call_tir`,
`call_packed`, `call_builtin` and `invoke_closure`.

* The API of `call_tir` is changed to
  ```python
  def call_tir(
      func: Union[str, Expr],
      args: Expr,
      out_sinfo: Union[TensorStructInfo, TupleStructInfo],
      tir_vars: Optional[Union[ShapeExpr, Tuple[PrimExpr], List[PrimExpr]]] = None,
  ) -> Call:
      ...
  ```
  where we combine the `shape` and `dtype` parameters into `out_sinfo`. In
  the concrete CallNode of `call_tir`, the output shape is no longer passed
  as an CallNode argument and passed in the `sinfo_args` instead.

* For `call_packed`, `call_builtin` and `invoke_closure`, we change the
  `type_args` parameter to `sinfo_args`. For example, the API of `call_packed`
  is updated to
  ```python
  def call_packed(
      func: str,
      *args: Expr,
      sinfo_args: Union[StructInfo, List[StructInfo]],
      **kwargs: Any,
  ) -> Call:
      ...
  ```

---

One thing specific to note is about our existing dataflow pattern language.
Previously we have a sugar function for `call_tir`:
```python
def is_call_tir(
    func_name: str,
    args: Union[List, Tuple, TuplePattern] = None,
    shape: Union[Tuple, List[tvm.ir.PrimExpr], DFPattern] = None,
) -> CallPattern:
    ...
```
Since we changed the API of `call_tir` - the CallNode does not contain the
shape as one argument, - together with the fact that the dataflow pattern
language does not yet support matching StructInfo, we have no approach to
match the shape anymore. Therefore, the `shape` parameter is removed from
`is_call_tir`. I left some Todo items there for future `sinfo_args` matching
support.

* Update call_tir API and address comments

Now the expected type of `out_sinfo` is:
```python
out_sinfo: Union[TensorStructInfo, List[TensorStructInfo]]
```
junrushao pushed a commit to junrushao/tvm that referenced this issue Feb 8, 2023
This PR is the last part of the `sinfo_args` switch tracked by apache#377,
which adds the StructInfo check in well-formed check, to ensure that
the StructInfo in `sinfo_args` does not refer to any undefined
symbolic variables.
mbaret pushed a commit to mbaret/tvm that referenced this issue Feb 13, 2023
This PR is the kickoff action of our switch towards `sinfo_args` in
CallNode, as discussed in apache#356 and tracked by apache#377.

* CallNode field `type_args` is changed to `sinfo_args`, with type
`Array<StructInfo>`.

* For intrinsic ops like `call_tir`/`call_packed`, this PR keeps the
`sinfo_args` value as **the plain StructInfo generated from the static
type**, even if those op calls were provided with richer StructInfo at
the time of creation. The API changes, creations and structure info
deductions of these intrinsic ops will be left to the next PR, as the
tracking issue apache#377. Since that PR, our APIs and structure info
deductions of these ops will no longer rely on types.
mbaret pushed a commit to mbaret/tvm that referenced this issue Feb 13, 2023
This PR is part of the `sinfo_args` switch, as tracked by apache#377.

This PR removes VisitType from ExprFunctor in Relax, as Type is no
longer a standalone construct in any Relax AST, with the switch of
`sinfo_args` introduced by apache#379.
mbaret pushed a commit to mbaret/tvm that referenced this issue Feb 13, 2023
… etc. (apache#386)

* [Refactor][AST] `sinfo_args` A1: Update API of call_tir, call_packed, etc

Following apache#377 and apache#379, this PR followups to update the API of `call_tir`,
`call_packed`, `call_builtin` and `invoke_closure`.

* The API of `call_tir` is changed to
  ```python
  def call_tir(
      func: Union[str, Expr],
      args: Expr,
      out_sinfo: Union[TensorStructInfo, TupleStructInfo],
      tir_vars: Optional[Union[ShapeExpr, Tuple[PrimExpr], List[PrimExpr]]] = None,
  ) -> Call:
      ...
  ```
  where we combine the `shape` and `dtype` parameters into `out_sinfo`. In
  the concrete CallNode of `call_tir`, the output shape is no longer passed
  as an CallNode argument and passed in the `sinfo_args` instead.

* For `call_packed`, `call_builtin` and `invoke_closure`, we change the
  `type_args` parameter to `sinfo_args`. For example, the API of `call_packed`
  is updated to
  ```python
  def call_packed(
      func: str,
      *args: Expr,
      sinfo_args: Union[StructInfo, List[StructInfo]],
      **kwargs: Any,
  ) -> Call:
      ...
  ```

---

One thing specific to note is about our existing dataflow pattern language.
Previously we have a sugar function for `call_tir`:
```python
def is_call_tir(
    func_name: str,
    args: Union[List, Tuple, TuplePattern] = None,
    shape: Union[Tuple, List[tvm.ir.PrimExpr], DFPattern] = None,
) -> CallPattern:
    ...
```
Since we changed the API of `call_tir` - the CallNode does not contain the
shape as one argument, - together with the fact that the dataflow pattern
language does not yet support matching StructInfo, we have no approach to
match the shape anymore. Therefore, the `shape` parameter is removed from
`is_call_tir`. I left some Todo items there for future `sinfo_args` matching
support.

* Update call_tir API and address comments

Now the expected type of `out_sinfo` is:
```python
out_sinfo: Union[TensorStructInfo, List[TensorStructInfo]]
```
mbaret pushed a commit to mbaret/tvm that referenced this issue Feb 13, 2023
This PR is the last part of the `sinfo_args` switch tracked by apache#377,
which adds the StructInfo check in well-formed check, to ensure that
the StructInfo in `sinfo_args` does not refer to any undefined
symbolic variables.
yelite pushed a commit to yelite/tvm that referenced this issue Feb 17, 2023
This PR is the kickoff action of our switch towards `sinfo_args` in
CallNode, as discussed in apache#356 and tracked by apache#377.

* CallNode field `type_args` is changed to `sinfo_args`, with type
`Array<StructInfo>`.

* For intrinsic ops like `call_tir`/`call_packed`, this PR keeps the
`sinfo_args` value as **the plain StructInfo generated from the static
type**, even if those op calls were provided with richer StructInfo at
the time of creation. The API changes, creations and structure info
deductions of these intrinsic ops will be left to the next PR, as the
tracking issue apache#377. Since that PR, our APIs and structure info
deductions of these ops will no longer rely on types.
yelite pushed a commit to yelite/tvm that referenced this issue Feb 17, 2023
This PR is part of the `sinfo_args` switch, as tracked by apache#377.

This PR removes VisitType from ExprFunctor in Relax, as Type is no
longer a standalone construct in any Relax AST, with the switch of
`sinfo_args` introduced by apache#379.
yelite pushed a commit to yelite/tvm that referenced this issue Feb 17, 2023
… etc. (apache#386)

* [Refactor][AST] `sinfo_args` A1: Update API of call_tir, call_packed, etc

Following apache#377 and apache#379, this PR followups to update the API of `call_tir`,
`call_packed`, `call_builtin` and `invoke_closure`.

* The API of `call_tir` is changed to
  ```python
  def call_tir(
      func: Union[str, Expr],
      args: Expr,
      out_sinfo: Union[TensorStructInfo, TupleStructInfo],
      tir_vars: Optional[Union[ShapeExpr, Tuple[PrimExpr], List[PrimExpr]]] = None,
  ) -> Call:
      ...
  ```
  where we combine the `shape` and `dtype` parameters into `out_sinfo`. In
  the concrete CallNode of `call_tir`, the output shape is no longer passed
  as an CallNode argument and passed in the `sinfo_args` instead.

* For `call_packed`, `call_builtin` and `invoke_closure`, we change the
  `type_args` parameter to `sinfo_args`. For example, the API of `call_packed`
  is updated to
  ```python
  def call_packed(
      func: str,
      *args: Expr,
      sinfo_args: Union[StructInfo, List[StructInfo]],
      **kwargs: Any,
  ) -> Call:
      ...
  ```

---

One thing specific to note is about our existing dataflow pattern language.
Previously we have a sugar function for `call_tir`:
```python
def is_call_tir(
    func_name: str,
    args: Union[List, Tuple, TuplePattern] = None,
    shape: Union[Tuple, List[tvm.ir.PrimExpr], DFPattern] = None,
) -> CallPattern:
    ...
```
Since we changed the API of `call_tir` - the CallNode does not contain the
shape as one argument, - together with the fact that the dataflow pattern
language does not yet support matching StructInfo, we have no approach to
match the shape anymore. Therefore, the `shape` parameter is removed from
`is_call_tir`. I left some Todo items there for future `sinfo_args` matching
support.

* Update call_tir API and address comments

Now the expected type of `out_sinfo` is:
```python
out_sinfo: Union[TensorStructInfo, List[TensorStructInfo]]
```
yelite pushed a commit to yelite/tvm that referenced this issue Feb 17, 2023
This PR is the last part of the `sinfo_args` switch tracked by apache#377,
which adds the StructInfo check in well-formed check, to ensure that
the StructInfo in `sinfo_args` does not refer to any undefined
symbolic variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants