Skip to content

adding some additional docstrings #81

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

Merged
merged 3 commits into from
Aug 7, 2024
Merged

Conversation

pstjohn
Copy link
Collaborator

@pstjohn pstjohn commented Aug 7, 2024

Some additional work towards removing these docstring-ignore ruff rules

@pstjohn pstjohn requested a review from jstjohn August 7, 2024 18:08
Copy link
Collaborator

@skothenhill-nv skothenhill-nv left a comment

Choose a reason for hiding this comment

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

left a few small text suggestions

value: The value tensor of shape [sk, b, ng, hn].
attention_mask: The attention mask tensor of shape [b, np, sq, sk].
attn_mask_type: The attention mask type, currently unused. Defaults to None.
packed_seq_params: The packed sequence parameters. Defaults to None.
Copy link
Collaborator

Choose a reason for hiding this comment

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

packed_seq_params: The packed sequence parameters. These are used for context parallelism so will be needed to be implemented if we want to support this. Defaults to None.

Copy link
Collaborator

@jstjohn jstjohn left a comment

Choose a reason for hiding this comment

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

Approved with a few comments/suggestions.


!!! warning

Using F.gelu yields subtly wrong results.
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO can we figure out why they're wrong and explain that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

not necessarily in this PR just maybe track that we should improve this docstring.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@farhadrgh -- tagging you here, do you have an explanation as to why?

pstjohn and others added 2 commits August 7, 2024 14:24
@pstjohn
Copy link
Collaborator Author

pstjohn commented Aug 7, 2024

/build-ci

@pstjohn pstjohn merged commit 4539963 into v2-main Aug 7, 2024
2 checks passed
Comment on lines +32 to +46
class BionemoModelConfig(Generic[Model], ABC):
"""An abstract class for model configuration."""

@abstractmethod
def configure_model(self, *args, **kwargs) -> Model: # D101 # noqa: D102
def configure_model(self, *args, **kwargs) -> Model:
"""Configures the model."""
raise NotImplementedError()


class BionemoTrainableModelConfig(Generic[Model, Loss], BionemoModelConfig[Model]): # D101 # noqa: D101
class BionemoTrainableModelConfig(Generic[Model, Loss], BionemoModelConfig[Model]):
"""An abstract class for trainable model configuration."""

@abstractmethod
def get_loss_reduction_class(self) -> Type[Loss]: # D101 # noqa: D102
def get_loss_reduction_class(self) -> Type[Loss]:
"""Returns the loss reduction class."""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this ChatGPT output @pstjohn ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah copilot most likely

@pstjohn pstjohn deleted the pstjohn/v2-main/docs-add branch September 16, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants