nx icon indicating copy to clipboard operation
nx copied to clipboard

Upgrade NIF EXLA

Open samuelmanzanera opened this issue 1 year ago • 1 comments

Hello

I was trying to upgrade NX & EXLA through a hot upgrade process, however, the NIF is not supporting upgrade capability

ERL_NIF_INIT(Elixir.EXLA.NIF, exla_funcs, &load, NULL, NULL, NULL);

While TorchX supports it,

ERL_NIF_INIT(Elixir.Torchx.NIF, nif_functions, load, NULL, upgrade, NULL)

// ...
int upgrade(ErlNifEnv *env, void **priv_data, void **old_priv_data, ERL_NIF_TERM load_info) {
  // Silence "unused var" warnings.
  (void)(env);
  (void)(priv_data);
  (void)(old_priv_data);
  (void)(load_info);

  return 0;
}

Is there any reason for this choice ? Because in order to support hot upgrades of NX & Backend, then I have to rely on TorchX

samuelmanzanera avatar Jun 11 '24 13:06 samuelmanzanera

Please send a PR adding a similar callback. Thank you.

josevalim avatar Jun 11 '24 13:06 josevalim