Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Register custom model / loops outside of the VISSL directory #211

Open
pclucas14 opened this issue Mar 3, 2021 · 5 comments
Open

Register custom model / loops outside of the VISSL directory #211

pclucas14 opened this issue Mar 3, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@pclucas14
Copy link

pclucas14 commented Mar 3, 2021

🚀 Feature

I would like to be able to integrate custom code, such as custom model head / trunks, or custom training loops, without having to put them directly in the vissl directory

Motivation & Examples

Like many users, I like to download my packages via pip or conda. Right now I have to manually copy my new models to the vissl directory within my environment. The main issue I have with this is that I have to manually keep track of my added files should I do a vissl update.

Note

There is already something similar already established for datasets, where I can register a new one outside of the main codebase. If there would exist something like this for models that would be great.

@prigoyal
Copy link
Contributor

prigoyal commented Mar 3, 2021

Hi @pclucas14 , the new components can be registered by importing registeries of vissl https://github.com/facebookresearch/vissl/blob/master/vissl/trainer/train_steps/__init__.py#L19 for example importing this function. However, the current VISSL packages don't expose the register functions in __all__ method. But we welcome contributions :) In the next VISSL release in few weeks, we will look into incorporating this feature request :)

@pclucas14
Copy link
Author

ok great :) thanks for the heads up

@prigoyal prigoyal added the enhancement New feature or request label Mar 3, 2021
@pclucas14
Copy link
Author

Along similar lines, is it possible to add new hooks without modifying the hook init file ?

@prigoyal
Copy link
Contributor

prigoyal commented Mar 8, 2021

yep! we will open all the register functions along with the ones mentioned here! :)

@pclucas14
Copy link
Author

pclucas14 commented Mar 8, 2021

Great :) Sorry to add yet another point to this, but one thing to keep in mind for future PRs would be to ensure the compatibility with the distributed slurm launcher.

Currently I added new import lines in my version of run_distributed_engines.py which takes care of the registration. However when using the slurm launcher, launch_distributed from vissl/utils/distributed_launcher.py is called, which bypasses these imports. An easy hack for now is to modify distributed_launcher.py. In a perfect world if users could avoid modifying internal files usability would be even better.

Thanks again for the great support!

@prigoyal prigoyal self-assigned this Apr 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants