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

feat: Adding cuda:n device allocation #694

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nassarofficial
Copy link

@nassarofficial nassarofficial commented Jan 7, 2025

This PR is WIP enables the allocation of cuda devices as the current implementation defaults to cuda:0. This enables launching on multi-gpu and not being restricted on cluster systems with device allocation.

Note: Further investigation is needed to make easyocr work with cuda:n as easyocr when using GPU it wraps the models in torch.DataParallel, which causes cuda:0 to be utilised.

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

@nassarofficial nassarofficial added the enhancement New feature or request label Jan 7, 2025
Copy link

mergify bot commented Jan 7, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@nassarofficial nassarofficial force-pushed the ahn/multigpu_accelerate branch from 08872b9 to 7425436 Compare January 7, 2025 12:58
the same functionality. In case the alias envvar is set and the user tries to override the
parameter in settings initialization, Pydantic treats the parameter provided in __init__()
as an extra input instead of simply overwriting the evvar value for that parameter.
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is useful to stay. Why to delete it?

device: AcceleratorDevice = AcceleratorDevice.AUTO
device: str = "auto"

@validator("device")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to avoid using the @validator because it is deprecated in Pydantic v2. Use instead the newer "Field Validators" (https://docs.pydantic.dev/latest/concepts/validators/#field-validators)

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

Successfully merging this pull request may close these issues.

2 participants