Giter Club home page Giter Club logo

Comments (4)

Luodian avatar Luodian commented on August 17, 2024

launcher_fn(commands)

I modified these lines in "sweep.py", from line 80 to line 99.

I am not sure if this would be appropriate. At least, they work well on my system.

If so, would I be able to create a PR?

        all_gpu_counts = torch.cuda.device_count()
        commands_per_gpu = {}
        for i in range(all_gpu_counts):
            commands_per_gpu[i] = []

        idx = 0
        while idx < len(commands):
            for i in range(all_gpu_counts):
                if idx < len(commands):
                    commands_per_gpu[i].append("CUDA_VISIBLE_DEVICES={} {}".format(i, commands[idx]))
                    idx += 1

        multi_gpus_processes = []
        for i in range(all_gpu_counts):
            p = Process(target=launcher_fn, args=(commands_per_gpu[i],))
            p.start()
            multi_gpus_processes.append(p)

        for p in multi_gpus_processes:
            p.join()

from domainbed.

igul222 avatar igul222 commented on August 17, 2024

Hi, thanks for the interest in contributing! I think this is a good idea. A cleaner way to implement this would be as a command launcher in command_launchers.py. Just write a function that runs each command in a list, and add the function to the registry at the bottom of the file. You can use your command launcher by running sweep.py with the --command_launcher flag.

from domainbed.

igul222 avatar igul222 commented on August 17, 2024

I've gone ahead and taken a first shot at an implementation at 56196cc . Hope this helps!

from domainbed.

lopezpaz avatar lopezpaz commented on August 17, 2024

Thank you @igul222. Please re-open if necessary, @Luodian.

from domainbed.

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.