carakan

carakan

How to install and compile a git fork of torchx

I have a problem compiling my custom fork of torchx , here is a code that is failing in a local installation of livebook, (tried tons of combinations and this code is an example):

Mix.install(
  [
    {:bumblebee, "~> 0.4.2"},
    {:nx, "~> 0.6.1"},
    {:torchx, git: "https://github.com/carakan/nx"},
    {:kino, "~> 0.10.0"}
  ],
  force: true,
  config: [
    nx: [default_backend: Torchx]
  ],
  system_env: [
    # LIBTORCH_VERSION: "2.1.0",
    LIBTORCH_DIR: "~/Downloads/libtorch"
  ]
)

Nx.global_default_backend({Torchx.Backend, device: :mps})

and shows this error:

** (Mix.Error) App nx lists itself as a dependency
    (mix 1.15.5) lib/mix.ex:577: Mix.raise/2
    (elixir 1.15.5) lib/enum.ex:984: Enum."-each/2-lists^foreach/1-0-"/2
    (mix 1.15.5) lib/mix/dep/converger.ex:18: Mix.Dep.Converger.topological_sort/1
    (mix 1.15.5) lib/mix/dep/converger.ex:78: Mix.Dep.Converger.converge/4
    (mix 1.15.5) lib/mix/dep/fetcher.ex:16: Mix.Dep.Fetcher.all/3
    (mix 1.15.5) lib/mix/tasks/deps.get.ex:34: Mix.Tasks.Deps.Get.run/1
    (mix 1.15.5) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
    /Users/carakan/Documents/libtorch-sd.livemd#cell:cxwhmrbzgh2dnojn5rvaagoeuzcdk6gl:1: (file)

I noticed that torchx is like a submodule into Nx project so it’s like an error of circular dependency. How can I correctly add my custom fork of nx and tochx?

Thanks in advance!

Most Liked

jonatanklosko

jonatanklosko

Creator of Livebook

Try {:torchx, github: "carakan/nx", sparse: "torchx"}. Sparse means that the mix package is nested in the torchx/ directory in the github repo : )

Also note that the backend should be nx: [default_backend: Torchx.Backend] (although you use Nx.global_default_backend, so you don’t need that config altogether).

Where Next?

Popular in Questions Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
Werner
Hi, I’m using Ubuntu 18.04 and after updating to OTP-24.0 yesterday i have this warning when I run “mix local.hex”: 14:57:30.512 [warn] ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New

We're in Beta

About us Mission Statement