Git Product home page Git Product logo

Comments (10)

nrontsis avatar nrontsis commented on July 25, 2024

Thanks for opening the issue. Could you provide with a minimal example so that we investigate?

from pilco.

jaztsong avatar jaztsong commented on July 25, 2024

I'm simply using the example - PILCO/tests/test_predictions.py.

I tested on CPU and GPU version of both tensorflow 1.13.1 and 1.14.0. There was no problem for CPU tensorflow, but no luck on GPU version. My guess is that the problem occurred when the function predict_given_factorization passing through the autoflow of GPflow.

from pilco.

jaztsong avatar jaztsong commented on July 25, 2024

BTW, if possible, can you implement a GPytorch version? It looks like GPytorch outperforms GPflow in large data scenarios.

from pilco.

nrontsis avatar nrontsis commented on July 25, 2024

Can you try running PILCO/tests/test_predictions.py CORRECTION: examples/inverted_pendulum.py with the following changes?

controller = LinearController(state_dim=state_dim, control_dim=control_dim)

instead of

controller = RbfController(state_dim=state_dim, control_dim=control_dim, num_basis_functions=5)

and

pilco = PILCO(X, Y, controller=controller, horizon=10)

instead of

pilco = PILCO(X, Y, controller=controller, horizon=40)

The RL algorithm will probably not converge to any useful policy but I am curious to see if this is a memory or architecture issue.

from pilco.

nrontsis avatar nrontsis commented on July 25, 2024

When we wrote the repo GPytorch was not as mature as GPflow. I guess that switching to pytorch would be a great but unfortunately I might not have the time for such a big change (at least in the foreseeable future...)

from pilco.

jaztsong avatar jaztsong commented on July 25, 2024

I cannot try examples/inverted_pendulum.py on Jetson TX2, since installing the Mujoco(I actually using Roboschool) environment is excruciating. But I can confirm that the memory is not the issue as the memory usage didn't hike up when running the program.

After a two-day investigation, so far, my impression is that the operations in the function predict_given_fractorization caused cuda registers usage exceeding the existing resources.

from pilco.

kyr-pol avatar kyr-pol commented on July 25, 2024

Hi @jaztsong,

I had experience with resource allocation errors but it was memory issues in my case. They arise usually in the backward pass (when calculating gradients), where big matrices, order N^2D^2 with N the number of data points and D the number of dimensions are involved.

You could try something like reducing the number of data points used in the test, (it's a 100 and it's
hard coded, you'd have to change it in a few places) just to make sure it's not because of the demands of the algorithm. Excluding that would point to an issue with GPflow or CUDA (or tensorflow) and how they handle resources on your machine, but I wouldn't really know how to address that.

from pilco.

jaztsong avatar jaztsong commented on July 25, 2024

@kyr-po I actually changed the number of data points to 3, and it still broke. Bummer.

from pilco.

jaztsong avatar jaztsong commented on July 25, 2024

After debugging the code line by line for a few days, I finally solved the problem. It turned out the culprit is that the matrix determinant operation in mgpr.py on GPU caused some memory issue. The workaround solution I got is to calculate determinant by getting LU decomposition first and calculating the product of the diagonal units as the determinant.

The code can run now without error after the modification. However, the prediction speed is unacceptably high when data point number and output dimension ramp up, e.g., N = 40, D_output = 30.

Anyway, thank you for everyone's input.

from pilco.

nrontsis avatar nrontsis commented on July 25, 2024

Thanks a lot @jaztsong for the investigation! I believe that there is quite a big space for improvement in mgpr.py. Hopefully I will find time at some point to optimize it...

from pilco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.