# Small config bug in autotvm

**URL:** <https://discuss.tvm.apache.org/t/small-config-bug-in-autotvm/8285>\
**Category:** Development\
**Created:** [October 26, 2020, 1:58pm UTC](https://discuss.tvm.apache.org/t/small-config-bug-in-autotvm/8285 "2020-10-26T13:58:15Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![adi-muresan](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/adi-muresan/32/2071_2.png) [@adi-muresan](https://discuss.tvm.apache.org/u/adi-muresan)\
**Post date:** [October 26, 2020, 1:58pm UTC](https://discuss.tvm.apache.org/t/small-config-bug-in-autotvm/8285/1 "2020-10-26T13:58:15Z")

</div>

There is a small bug in `ConfigSpace` where if ` __repr__ ` is invoked before the config has finished collecting knobs / spaces, subsequently collected items will not count towards the size of the whole config space which will result in an incomplete run of autotuning. This is due to the caching compute of the config space [here](https://github.com/apache/incubator-tvm/blob/e59c603515befb02035e237794aa0645dbfbaf09/python/tvm/autotvm/task/space.py#L839).

The most straightforward fix would be something like this:

```
if self._length is None or self._collect:
     self._length = int(np.prod([len(x) for x in self.space_map.values()]))
 return self._length
```

---

_[View the full topic](https://discuss.tvm.apache.org/t/small-config-bug-in-autotvm/8285)._
