Repository: pytorch
Issue: [inductor][cpu]pyhpc_turbulent_kinetic_energy fp32 static shape cpp/default wrapper single thread performance regression
Labels: triaged,oncall: pt2,module: inductor,oncall: cpu inductor

### 🐛 Describe the bug

<p>float32 static shape cpp wrapper single threads</p><table border="1" class="dataframe table">
  <thead>
    <tr style="text-align: right;">
      <th>name</th>
      <th>batch_size_new</th>
      <th>speed_up_new</th>
      <th>inductor_new</th>
      <th>eager_new</th>
      <th>compilation_latency_new</th>
      <th>batch_size_old</th>
      <th>speed_up_old</th>
      <th>inductor_old</th>
      <th>eager_old</th>
      <th>compilation_latency_old</th>
      <th>Ratio Speedup(New/old)</th>
      <th>Eager Ratio(old/new)</th>
      <th>Inductor Ratio(old/new)</th>
      <th>Compilation_latency_Ratio(old/new)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>pyhpc_turbulent_kinetic_energy</td>
      <td>1048576</td>
      <td>0.87037</td>
      <td>0.219295456</td>
      <td>0.19086818603872</td>
      <td>44.685473</td>
      <td>1048576.0</td>
      <td>1.249137</td>
      <td>0.153570635</td>
      <td>0.191830762291995</td>
      <td>39.641774</td>
      <td>0.7</td>
      <td>1.01</td>
      <td>0.7</td>
      <td>0.89</td>
    </tr>
  </tbody>

</table><p>float32 static shape default wrapper single threads</p><table border="1" class="dataframe table">
  <thead>
    <tr style="text-align: right;">
      <th>name</th>
      <th>batch_size_new</th>
      <th>speed_up_new</th>
      <th>inductor_new</th>
      <th>eager_new</th>
      <th>compilation_latency_new</th>
      <th>batch_size_old</th>
      <th>speed_up_old</th>
      <th>inductor_old</th>
      <th>eager_old</th>
      <th>compilation_latency_old</th>
      <th>Ratio Speedup(New/old)</th>
      <th>Eager Ratio(old/new)</th>
      <th>Inductor Ratio(old/new)</th>
      <th>Compilation_latency_Ratio(old/new)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>pyhpc_turbulent_kinetic_energy</td>
      <td>1048576</td>
      <td>0.867707</td>
      <td>0.218174438</td>
      <td>0.189311487073666</td>
      <td>32.976794</td>
      <td>1048576.0</td>
      <td>1.245895</td>
      <td>0.153876764</td>
      <td>0.19171429088378</td>
      <td>32.299341</td>
      <td>0.7</td>
      <td>1.01</td>
      <td>0.71</td>
      <td>0.98</td>
    </tr>
  </tbody>


</table><p>SW info</p><table border="1" class="dataframe table">
  <thead>
    <tr style="text-align: right;">
      <th>SW</th>
      <th>Nightly commit</th>
      <th>Main commit</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Pytorch</td>
      <td>4749337</td>
      <td></td>
    </tr>
    <tr>
      <td>Torchbench</td>
      <td>/</td>
      <td>ff42d907</td>
    </tr>
    <tr>
      <td>torchaudio</td>
      <td>b2d9c3e</td>
      <td></td>
    </tr>
    <tr>
      <td>torchtext</td>
      <td>b0ebddc</td>
      <td></td>
    </tr>
    <tr>
      <td>torchvision</td>
      <td>315f315</td>
      <td></td>
    </tr>
    <tr>
      <td>torchdata</td>
      <td>0790338</td>
      <td></td>
    </tr>
    <tr>
      <td>dynamo_benchmarks</td>
      <td>nightly</td>
      <td>/</td>
    </tr>
  </tbody>
</table><p>Reference SW info (nightly)</p><table border="1" class="dataframe table">
  <thead>
    <tr style="text-align: right;">
      <th>item</th>
      <th>commit</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>torchbench</td>
      <td>ff42d907</td>
    </tr>
    <tr>
      <td>torch</td>
      <td>2.3.0a0+git54fee3b</td>
    </tr>
    <tr>
      <td>torchvision</td>
      <td>0.18.0a0+a00a72b</td>
    </tr>
    <tr>
      <td>torchtext</td>
      <td>0.16.0a0+b0ebddc</td>
    </tr>
    <tr>
      <td>torchaudio</td>
      <td>2.2.0a0+b2d9c3e</td>
    </tr>
    <tr>
      <td>torchdata</td>
      <td>0.7.0a0+11bb5b8</td>
    </tr>
    <tr>
      <td>dynamo_benchmarks</td>
      <td>nightly</td>
    </tr>
  </tbody>
</table>

Repro:
[inductor_single_run.sh](https://github.com/chuanqi129/inductor-tools/blob/main/scripts/modelbench/inductor_single_run.sh)
bash inductor_single_run.sh single inference performance torchbench pyhpc_turbulent_kinetic_energy float32 first static default/cpp
Suspected guilty commit: https://github.com/pytorch/pytorch/commit/978faf1fa29444f78a7ca805f8abc032cb29e0d8
[torchbench-pyhpc_turbulent_kinetic_energy-inference-float32-static-cpp-performance-single-drop_guilty_commit.log](https://github.com/pytorch/pytorch/files/14113026/torchbench-pyhpc_turbulent_kinetic_energy-inference-float32-static-cpp-performance-single-drop_guilty_commit.log)
cc @ezyang @msaroufim @bdhirsh @anijain2305 @zou3519 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler @WeizhuoZhang-intel @chuanqi129