-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
I've noticed that setting XLA_TARGET=xxx mix release compute will result in the libexla_extension.so being built with this name always, regardless of xxx.
This is a bit problematic, because it implies having as many releases defined as we want to target different architectures.
For example, our mix.exs file looks like this:
defp releases(),
do:
[
web: [
version: "0.0.1",
applications: [...]
],
worker: [
version: "0.0.1",
applications: [...]
]
]
|> add_compute_releases([:cuda120, :rocm])
defp add_compute_releases(acc, xla_targets),
do:
xla_targets
|> Enum.reduce(acc, fn xla_target, acc ->
acc ++
[
{:"compute_#{xla_target}",
[
version: "0.0.1",
applications: [...]
]}
]
end)This results in a list of releases available such as web, worker, compute_cuda120, compute_rocm.
This is a bit cumbersome, given that the only thing that changes between the two compute_xxx releases seems to be libexla_extension.so...
A few ideas here:
- It would be really nice being able to indicate more than one XLA target architecture. Then upon starting the release, we would specify which one to use, and a different
libexla_extension_xxx.socould be picked (via symlink?). - Not having to toy too much with ENV variables (
XLA_TARGET) could be really nice. For example, being able to indicate the architectures directly inmix.exs, maybe even in thereleasessection... - Why not pluralizing
XLA_RELEASEintoXLA_RELEASES, telling XLA to build as many as requested, so that a release could embed manylibexla_extension_xxx.soand do the switcheroo at boot?
Let me know if I misunderstood anything!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels