Skip to content

Commit 16de130

Browse files
committed
Fix vgid inheritance for CopyVarUpdate op
Summary: With D84885 fixed detach creation for model parameters. However, it turnes out that all such detach ops do have active_stage set to 0. That leads to requiredVgid in PopART being zero as well which - incorrectly - overwrites valid vgid inherited from batchnorm op. !ci_branch_mk2 Test Plan: CI Reviewers: #popart, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, kamil.andrzejewski Reviewed By: #popart, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, kamil.andrzejewski JIRA Issues: AFS-363 Differential Revision: https://phabricator.sourcevertex.net/D85622
1 parent f00b735 commit 16de130

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

willow/src/opattributehelper.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "popart/alias/aliasmodel.hpp"
2424
#include "popart/basicoptionals.hpp"
25+
#include "popart/graphcoreoperators.hpp"
2526
#include "popart/graphid.hpp"
2627
#include "popart/logging.hpp"
2728
#include "popart/names.hpp"
@@ -533,8 +534,12 @@ void InheritOpAttributeHelper::setAttributes() {
533534
//__|________________|______ phase 2, vgid 0
534535
// `------------ VarUpdate <- will inherit wrong phase and vgid
535536
//
537+
// CopyVarUpdate is en exception as PopTorch incorrectly sets the active_stage
538+
// attribute for all detach parameter ops to 0 and it's not possible to fix it
539+
// there. PopART must ignore requiredVgid for CopyVarUpdate op.
536540
if (requiredVgid &&
537-
(!op->hasVirtualGraphId() || op->getVirtualGraphId() != *requiredVgid)) {
541+
(!op->hasVirtualGraphId() || op->getVirtualGraphId() != *requiredVgid) &&
542+
op->opid != Onnx::AiGraphcore::OpSet1::CopyVarUpdate) {
538543
logging::op::debug("[InheritOpAttributeHelper::setAttributes] Changing Op "
539544
"{} placement to required VGID: {}",
540545
op->debugName(),

0 commit comments

Comments
 (0)