hsuanguo commented on a change in pull request #7188:
URL: https://github.com/apache/tvm/pull/7188#discussion_r559239285



##########
File path: python/tvm/topi/cuda/ssd/multibox.py
##########
@@ -341,47 +341,25 @@ def transform_loc(loc, loc_base_idx, anchor, 
anchor_base_idx, clip, vx, vy, vw,
         i = idxd(tid, num_anchors)
         j = idxm(tid, num_anchors)
 
-        with ib.if_scope(cls_id[tid] > 0):
-            with ib.if_scope(tid == 0):
-                out_base_idx = i * num_anchors * 6
-                out_loc[out_base_idx] = cls_id[tid] - 1.0
-                out_loc[out_base_idx + 1] = score[tid]
-                (
-                    out_loc[out_base_idx + 2],
-                    out_loc[out_base_idx + 3],
-                    out_loc[out_base_idx + 4],
-                    out_loc[out_base_idx + 5],
-                ) = transform_loc(
-                    loc_pred,
-                    tid * 4,
-                    anchor,
-                    j * 4,
-                    clip,
-                    variances[0],
-                    variances[1],
-                    variances[2],
-                    variances[3],
-                )
-            with ib.else_scope():
-                out_base_idx = i * num_anchors * 6 + temp_valid_count[tid - 1] 
* 6
-                out_loc[out_base_idx] = cls_id[tid] - 1.0
-                out_loc[out_base_idx + 1] = score[tid]
-                (
-                    out_loc[out_base_idx + 2],
-                    out_loc[out_base_idx + 3],
-                    out_loc[out_base_idx + 4],
-                    out_loc[out_base_idx + 5],
-                ) = transform_loc(
-                    loc_pred,
-                    tid * 4,
-                    anchor,
-                    j * 4,
-                    clip,
-                    variances[0],
-                    variances[1],
-                    variances[2],
-                    variances[3],
-                )
+        out_base_idx = i * num_anchors * 6 + tid * 6

Review comment:
       You are right, it doesn't actually solve the race condition with this, 
it just however reduced the chance on my test env as I can no longer re-produce 
the issue I had with this.
   Sorry for the inaccuracy here. This PR was initially only for the 
initialization part.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to