Skip to content
Snippets Groups Projects

Hotfix the default backend issue

Merged Benjamin Halimi requested to merge fix_backend into dev
2 unresolved threads

Description

Previous policy regarding the backend management in the PTQ was to set the new nodes backends to their parent ones.

While it looks like a valid approach, it has two caveats :

  • Firstly, the parent may not have any backend (like for example the Concat nodes) which causes a registrar issue.
  • Secondly, the whole graphView backend is overwritten multiple times in the PTQ pipeline so the information about the original parent backend is in fact lost.

In absence of a better solution, we propose (for now) to set the new nodes backends to cpu by default, and to overwrite the whole graphView backend if useCuda is set to true.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
117
118 if (backend != "")
119 return backend;
120 else
121 {
122 // gather the parent backends
123
124 std::set<std::string> parentBackends;
125 for (auto parent : node->getParents())
126 parentBackends.insert(determineBackend(parent)); // it always answers a non empty value !
127
128 // check if we have two or more different backends gathered
129
130 if (parentBackends.size() > 1)
131 {
132 Log::warn(" Unable to determine backend of node {} due to conflicting parent ones !", node->name());
  • @olivierbichler If we have multiple backend tensor connected to an operator shouldn't we raise an error?

    I think this is related to the talks we add about transmiters when we were specifying Aidge. If we change backend inside the graph we need a conversion node since no opeartor should be able to handle multiple backend...

  • No, this is possible. It depends on the operator implementation. Most CUDA operator implementations handle multiple backend input and convert to CUDA internally.

  • It works for CUDA but not the over way arround! I think it would be better that implementation does not convert input implicitly as it would create an obfuscated mecanic to the user. Knowing which operator can convert to which backend etc ... I would be in favor of adding an explicit convert operator in order to enforce a uniform backend for the input of each operators.

  • Please register or sign in to reply
  • added 1 commit

    • 2e21e5dd - make use of determineBackend()

    Compare with previous version

  • I'm not reviewer... Please, change with Olivier

  • Cyril Moineau requested review from @olivierbichler and removed review request for @mick94

    requested review from @olivierbichler and removed review request for @mick94

  • Lets go with that!

  • Olivier BICHLER approved this merge request

    approved this merge request

  • Olivier BICHLER mentioned in commit f2713d00

    mentioned in commit f2713d00

  • mentioned in issue #69 (closed)

  • I check the good behaviour of the fix with a Yolo V3 and the concat layer (operator without banckend !)

  • changed milestone to %aidge v0.6.0

  • Please register or sign in to reply
    Loading