xla icon indicating copy to clipboard operation
xla copied to clipboard

Handle local archives without requiring network tooling

Open lexmag opened this issue 1 year ago • 4 comments

lexmag avatar Dec 12 '23 10:12 lexmag

I am not a big fan of this approach. The current implementation is too complex by trying to support three different formats and it does not work on Windows. Perhaps it would make more sense to introduce another environment variable, instead of overloading this one?

josevalim avatar Dec 12 '23 11:12 josevalim

@josevalim I just thought the same, we can have XLA_ARCHIVE_PATH. And we don't have to copy it to the cache dir, since the file is already accessible locally!

jonatanklosko avatar Dec 12 '23 11:12 jonatanklosko

I'm personally also not that positive about supporting file: all the way. That's said, I think if we decide to go just with a single format (for example, empty host), it is justifiable and does not seem worse than adding an extra environment variable (which, in turn, brings a question of priority).

lexmag avatar Dec 13 '23 11:12 lexmag

@lexmag there's still the advantage of not creating a copy of the file at all. And having an env var for path makes it much more intuitive/discoverable. I don't think prioritisation is an issue, we can check the path before url, similarly to how we respect XLA_BUILD=true first. So the path env var check would go between these:

https://github.com/elixir-nx/xla/blob/137ca696e13e66af34d45bdb77704e3de0a3d1cd/lib/xla.ex#L22-L29

jonatanklosko avatar Dec 13 '23 11:12 jonatanklosko