# New top level python namespace: tvm/utils

**URL:** <https://discuss.tvm.apache.org/t/new-top-level-python-namespace-tvm-utils/12683>\
**Category:** Development\
**Created:** [April 29, 2022, 5:10pm UTC](https://discuss.tvm.apache.org/t/new-top-level-python-namespace-tvm-utils/12683 "2022-04-29T17:10:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkonolige](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/tkonolige/32/1972_2.png) [@tkonolige](https://discuss.tvm.apache.org/u/tkonolige)\
**Post date:** [April 29, 2022, 5:10pm UTC](https://discuss.tvm.apache.org/t/new-top-level-python-namespace-tvm-utils/12683/1 "2022-04-29T17:10:57Z")

</div>

Hi All,

We are adding a new top-level namespace for python: tvm/utils. This is a space for “high-level” utilities around tvm that don’t quite fix into the existing namespaces. Right now it just contains some functions to do roofline analysis.

---

<div class="post-metadata">

**Author:** ![mbrookhart](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/mbrookhart/32/1432_2.png) [@mbrookhart](https://discuss.tvm.apache.org/u/mbrookhart)\
**Post date:** [April 29, 2022, 7:44pm UTC](https://discuss.tvm.apache.org/t/new-top-level-python-namespace-tvm-utils/12683/2 "2022-04-29T19:44:47Z")

</div>

👍 I think this makes sense, I’ve seen utils in a lot of projects.

---

<div class="post-metadata">

**Author:** ![areusch](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/areusch/32/2118_2.png) [@areusch](https://discuss.tvm.apache.org/u/areusch)\
**Post date:** [April 29, 2022, 9:19pm UTC](https://discuss.tvm.apache.org/t/new-top-level-python-namespace-tvm-utils/12683/3 "2022-04-29T21:19:14Z")

</div>

I’m okay with this, but I’d like to make one request: a very common problem with utils in my experience is that it becomes the kitchen sink. Could we consider adopting a convention e.g.

src/utils/irmodule\_util.cc src/utils/relay\_util.cc

e.g. granular enough so that it’s clear where someone adding a utils should place things?

additionally, what should we do about utils.cc which may already live elsewhere?

```auto
~/ws/tvm2$ find . -name '*utils.cc'
./src/relay/qnn/utils.cc
./src/relay/backend/utils.cc
./src/relay/backend/contrib/ethosu/utils.cc
./src/relay/transforms/infer_layout_utils.cc
./src/auto_scheduler/utils.cc
./src/auto_scheduler/search_policy/utils.cc
./src/te/autodiff/ad_utils.cc
./src/te/operation/op_utils.cc
./src/target/metadata_utils.cc
./src/tir/usmp/utils.cc
./src/tir/analysis/device_constraint_utils.cc
./src/tir/transforms/ir_utils.cc
./src/runtime/file_utils.cc
./src/runtime/source_utils.cc
./src/runtime/contrib/miopen/miopen_utils.cc
./src/runtime/contrib/nnpack/nnpack_utils.cc
./src/runtime/contrib/cublas/cublas_utils.cc
./src/runtime/contrib/arm_compute_lib/acl_utils.cc
./src/runtime/contrib/cudnn/cudnn_utils.cc

```
