Skip to content

Commit

Permalink
Fix calling numel on symbolic shapes issue
Browse files Browse the repository at this point in the history
Summary:
`indices` could be symbolic shapes, calling `numel` on symbolic shapes will trigger a compilation issue as below: {F1974666689}

To fix the issue, we change `numel` to `sym_numel` in this diff to be compatible with symbolic shapes

Differential Revision: D68675691
  • Loading branch information
Microve authored and facebook-github-bot committed Jan 27, 2025
1 parent e7c08e3 commit 0cf7eeb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,8 @@ class {{ autograd_func }} :
<< "T=" << T << ","
<< "avg_D=" << ({{ "total_D / T" if not nobag else "D" }}) << ","
<< "max_D=" << {{ "max_D" if not nobag else "D" }} << ","
<< "num_indices=" << indices.numel() << ","
<< "avg_pooling_fac=" << (static_cast<float>(indices.numel()) / T / max_B_)
<< "num_indices=" << indices.sym_numel() << ","
<< "avg_pooling_fac=" << (static_cast<c10::SymFloat>(indices.sym_numel()) / T / max_B_)
<< "]";
op_annotation = ss.str();
record_trace = profiler::record_function_enter_new(
Expand Down

0 comments on commit 0cf7eeb

Please sign in to comment.