Commit Graph

5 Commits

Author SHA1 Message Date
Florin Blanaru 553eb1acd0 [tests] add utility to replace direct call to pytest.main (#11393) 2022-05-23 11:52:22 -07:00
Mehrdad Hessar 4eb6497adb [ARM][Strategy] Fix is_int8_hw_support check function (#11193)
* Fix hw schedule condition

* add warning messages to unoptimized schedules
2022-05-11 15:26:48 -07:00
Christopher Sidebottom 796e71aa74 Add Python representation for VirtualDevice (#9812)
* Add Python representation for VirtualDevice

This adds a Python class to represent the VirtualDevice so that the
behaviour for `device_type()` can be semi-replicated.

These tests were actually not being ran and were broken so I've added
them to the integration script.

* Update other references to make_virtual_device
2022-01-04 15:49:07 +00:00
Mark Shields bd61d18c19 [Relay] s/SEScope/VirtualDevice/g (#9759)
* [Relay] s/SEScope/VirtualDevice/g

Nobody liked 'SEScope', and 'DeviceMcDeviceFace' is too verbose, so it
seems 'VirtualDevice' has the popular vote.
2021-12-17 09:53:07 -05:00
Mark Shields a6c948ac64 Adds SEScope (Storage/Execution Scope) for use as new unit of planning in 'device' planning. (#9313)
[Target] Adds SEScope (Storage/Execution Scope) for use as new unit of planning in 'device' planning

This is the first step in https://github.com/apache/tvm-rfcs/pull/38 to bring devices
and targets together when doing device planning. I've gone ahead and also included a
memory scope in this object since we will also need to propagate memory scopes across
Relay expressions once this basic preparation is in place. In the meantime that field will be
left as "".

Once device planning works in units of SEScopes it will be possible to directly read off
the device and target for any Relay sub-expression without the need for TargetMaps ort
the construction of default Targets.

SEScopes also support 'Join' and 'Default' operations needed when constraint solving in
the device planner. You can see those in use in my scratchpad branch:
  https://github.com/mbs-octoml/mbs-tvm/tree/mbs-scopes

This PR also brings some duplicated and the ad-hoc 'default target' handling logic
together into a CompilationConfig class. (Again, see the scratchpad branch for how that
will end up being used). I've placed that next to SEScope since it's main purpose is to
  a) establish the default SEScope for primitive ops
  b) establish the SEScope for the 'host'
  c) feed a definitive vector of Targets into device planning so it can resolve all
     "on_device" and "device_copy" device references to their full SEScope form.

* Reworked to avoid global SEScopeCache.

Realized while working through unit tests in the sequel that it's reasonable
for folks to call build multiple times with distinct Target objects, in which
case the global cache would grow without bound.

So instead placed the cache in the CompilationConfig class. Since that class
now has everything the device planner needs to do its job, promoted it to
be an FFI-able Object, which is now in compilation_config.{h,cc}.

I think we can do much better with CompilationConfig, but for now keeping it
to the minimum I needed to prepare for device planning from all the executor
compilation codepaths.
2021-11-03 12:37:28 -04:00