Repository: pytorch
Issue: JIT fuser throws compilation error (1.10 regression)
Labels: oncall: jit,module: regression,NNC

## 🐛 Bug

## To Reproduce

The following code:
```py
# pip install fvcore
import torch
from torch.nn import functional as F
def sigmoid_focal_loss(
    inputs: torch.Tensor,
    targets: torch.Tensor,
    alpha: float = -1,
    gamma: float = 2,
    reduction: str = "none",
) -> torch.Tensor:
    p = torch.sigmoid(inputs)
    ce_loss = F.binary_cross_entropy_with_logits(inputs, targets, reduction="none")
    p_t = p * targets + (1 - p) * (1 - targets)
    loss = ce_loss * ((1 - p_t) ** gamma)
    if alpha >= 0:
        alpha_t = alpha * targets + (1 - alpha) * (1 - targets)
        loss = alpha_t * loss
    if reduction == "mean":
        loss = loss.mean()
    elif reduction == "sum":
        loss = loss.sum()
    return loss
sigmoid_focal_loss_jit = torch.jit.script(
    sigmoid_focal_loss
)

def logit(x):
    return torch.log(x / (1-x))

device = torch.device("cuda:0")
inputs = logit(torch.rand(364703, 80)).to(device).half()
targets = torch.randint(0, 2, (364703, 80)).half().to(device)
focal_loss_jit = sigmoid_focal_loss_jit(inputs, targets, gamma=2.0,
        alpha=0.25, reduction="sum")
inputs = logit(torch.rand(308897, 80)).to(device).half()
targets = torch.randint(0, 2, (308897, 80)).half().to(device)
focal_loss_jit = sigmoid_focal_loss_jit(inputs, targets, gamma=2.0,
        alpha=0.25, reduction="sum")

```
inside the container `pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime`, throws the following error:
```
Traceback (most recent call last):
  File "a.py", line 15, in <module>
    alpha=0.25, reduction="sum")
RuntimeError: default_program(58): error: more than one instance of overloaded function "pow" matches the argument list:
            function "pow(double, double)"
__nv_nvrtc_builtin_header.h(150131): here
            function "pow(float, float)"
__nv_nvrtc_builtin_header.h(150790): here
            function "pow(float, int)"
__nv_nvrtc_builtin_header.h(150797): here
            argument types are: (float, double)

1 error detected in the compilation of "default_program".

nvrtc compilation failed:

#define NAN __int_as_float(0x7fffffff)
#define POS_INFINITY __int_as_float(0x7f800000)
#define NEG_INFINITY __int_as_float(0xff800000)


template<typename T>
__device__ T maximum(T a, T b) {
  return isnan(a) ? a : (a > b ? a : b);
}

template<typename T>
__device__ T minimum(T a, T b) {
  return isnan(a) ? a : (a < b ? a : b);
}


#define __HALF_TO_US(var) *(reinterpret_cast<unsigned short *>(&(var)))
#define __HALF_TO_CUS(var) *(reinterpret_cast<const unsigned short *>(&(var)))
#if defined(__cplusplus)
  struct __align__(2) __half {
    __host__ __device__ __half() { }

  protected:
    unsigned short __x;
  };

  /* All intrinsic functions are only available to nvcc compilers */
  #if defined(__CUDACC__)
    /* Definitions of intrinsics */
    __device__ __half __float2half(const float f) {
      __half val;
      asm("{  cvt.rn.f16.f32 %0, %1;}\n" : "=h"(__HALF_TO_US(val)) : "f"(f));
      return val;
    }
```

However the same code works in pytorch 1.9.

## Environment

the abovementioned docker container