Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.rb does not work on TruffleRuby #45

Closed
mtortonesi opened this issue Aug 11, 2023 · 3 comments
Closed

torch.rb does not work on TruffleRuby #45

mtortonesi opened this issue Aug 11, 2023 · 3 comments

Comments

@mtortonesi
Copy link
Contributor

I am trying to get torch.rb working with TruffleRuby (version truffleruby+graalvm-23.0.0 installed with rbenv+ruby_build on a M1 MacBookPro), but unfortunately when I launch the following TensorOption instantiation command:

bundle exec ruby -e 'require "torch"; Torch::TensorOptions.new(1,2,3)'

I get the following error:

/Users/mauro/code/test/truffleruby/reinforce/vendor/bundle/truffleruby/3.1.3.23.0.0/gems/rice-4.1.0/include/rice/rice.hpp:4094:in `call': External LLVMFunction rb_frame_method_id_and_class cannot be found. (Polyglot::ForeignException)
	from /Users/mauro/.rbenv/versions/truffleruby+graalvm-23.0.0/graalvm/Contents/Home/languages/ruby/lib/truffle/truffle/cext_ruby.rb:41:in `'
	from /Users/mauro/.rbenv/versions/truffleruby+graalvm-23.0.0/graalvm/Contents/Home/languages/ruby/lib/truffle/truffle/cext_ruby.rb:41:in `Torch::TensorOptions#initialize'

I would like to help fixing this, but I really wouldn't know where to start. Any suggestions?

(Cross-reference with this issue on the TruffleRuby repo.)

@ankane
Copy link
Owner

ankane commented Aug 13, 2023

Hi @mtortonesi, TruffleRuby isn't supported, and I don't really have the expertise to help with this. I think the first step would be getting Rice working with TruffleRuby, as the test suite currently fails.

@ankane ankane closed this as completed Aug 13, 2023
@mtortonesi
Copy link
Contributor Author

mtortonesi commented Dec 27, 2023

FYI, I just submitted oracle/truffleruby#3363, that implements the rb_frame_method_id_and_class in Truffleruby. The patch seems to get rice, and in turn torch.rb, to work with Truffleruby.

(See also oracle/truffleruby#3357.)

@ankane
Copy link
Owner

ankane commented Dec 27, 2023

Great, thanks @mtortonesi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants