GithubHelp home page GithubHelp logo

Comments (4)

kengz avatar kengz commented on August 25, 2024

pasted from #385

If i have 20 CPUS, 10 envs, 5 sessions, then it will starup 50 process with 20 CPUS, i consider it is not reasonable, am i right ? how can i fullly and reasonable use my CPU resource?

from slm-lab.

kengz avatar kengz commented on August 25, 2024

resource allocation with the search module works like so:

  1. ray detects how many CPUs you have, say 20 in total. This is the compute budget.
  2. resource setting u saw in search.py is per trial. If a trial has 3 sessions, it assigns 3 CPUs. So, it can assign 6 trials to utilize 18 CPUs within its budget.

All these assume that environments are very light on CPUs and RAM (memory). If your environment is requires more resources, you can limit the number of trials ran in parallel by changing the line with a multiplier to allocate more per trial:

# either scale by ur num envs if it dominates the resources
multiplier = ps.get(spec, 'env.0.num_envs') * 0.2
# or simply set a convenient number for your use case
multiplier = 4
num_cpus = min(util.NUM_CPUS, meta_spec['max_session'] * multiplier)

Then, a trial with 3 sessions will use 12 CPUs, and so only 1 trial gets ran at a time. This will allocate the budget more reasonably for your use case

from slm-lab.

lidongke avatar lidongke commented on August 25, 2024

I advise u to expose "multiplier" to out , so that we can more reasonably use more envs that not light.

from slm-lab.

kengz avatar kengz commented on August 25, 2024

good suggestion. will do so hopefully sometime this weekend

from slm-lab.

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.