Uh oh!
There was an error while loading. Please reload this page.
Adding documents to TE/JAX - #87
Conversation
zlsh80826
commented
Mar 9, 2023
/te-ci |
ksivaman
commented
Mar 9, 2023
@mingxu1067@jeng1220 Looks like there are a lot of duplicate commits here, could you please rebase with main? |
ksivaman
commented
Mar 9, 2023
Since #54 is merged now, we can remove the WIP tag too |
jeng1220
commented
Mar 9, 2023
@mingxu1067 , |
mingxu1067
commented
Mar 9, 2023
e823240 to
d449c12CompareThere was a problem hiding this comment.
@mingxu1067 ,
Could you help to make import order to be ordered alphabetically?
zlsh80826
commented
Mar 9, 2023
/te-ci |
There was a problem hiding this comment.
The copyright statement needs to be updated
ksivaman
commented
Mar 9, 2023
Could we combine #88 with this PR? I think the scope of this PR is documentation and that change falls within this. I want to avoid burdening the ci with a bunch of small PRs especially when they can be combined. This would speed up the dev/review/merge process. @mingxu1067 |
mingxu1067
commented
Mar 10, 2023
Signed-off-by: Ming Huang <mingh@nvidia.com>
Signed-off-by: Ming Huang <mingh@nvidia.com>
Signed-off-by: Ming Huang <mingh@nvidia.com>
Signed-off-by: Ming Huang <mingh@nvidia.com>
Signed-off-by: Ming Huang <mingh@nvidia.com>
zlsh80826
commented
Mar 13, 2023
/te-ci |
| ------- | ||
| .. autoapiclass:: transformer_engine.jax.LayerNorm(epsilon=1e-6, layernorm_type='layernorm', **kwargs) | ||
| :members: __call__ |
There was a problem hiding this comment.
| :members: __call__ | |
| :members: __call__ |
| axis name in Mesh used to shard batch along. | ||
| if it is None, then disabling data parallelism. | ||
| The axis name in Mesh used to shard batches along. | ||
| If it is None, then disabling data parallelism. |
There was a problem hiding this comment.
| IfitisNone, thendisablingdataparallelism. | |
| IfitisNone, thendataparallelismisdisabled. |
| axis name in Mesh used to split model tensor along. | ||
| if it is None, then disabling tensor parallelism. | ||
| The axis name in Mesh used to split the hidden dimensions along. | ||
| If it is None, then disabling tensor parallelism. |
There was a problem hiding this comment.
| IfitisNone, thendisablingtensorparallelism. | |
| IfitisNone, thentensorparallelismisdisabled. |
Signed-off-by: Ming-Xu Huang <mingh@nvidia.com>
| The key in given RNGs via flax.linen.Module.apply that | ||
| to generate Dropout masks in the core attention. |
There was a problem hiding this comment.
This doesn't read too well. Maybe just some grammar fix
There was a problem hiding this comment.
Fixed as the suggestion below
| The key in given RNGs via flax.linen.Module.apply that | ||
| to generate Dropout masks in the core attention. |
There was a problem hiding this comment.
| ThekeyingivenRNGsviaflax.linen.Module.applythat | |
| togenerateDropoutmasksinthecoreattention. | |
| ThekeyinthegivenRNGsviaflax.linen.Module.applythatis | |
| usedtogenerateDropoutmasksinthecoreattention. |
There was a problem hiding this comment.
Yes, it is. Change to the suggestion. THX
| kernel_init: Initializer, default = | ||
| flax.linen.initializers.variance_scaling(1.0, 'fan_in', 'normal') | ||
| used for initializing weights of QKV and Output projection weights. | ||
| Used for initializing weights of QKV and Output projection weights. |
There was a problem hiding this comment.
| UsedforinitializingweightsofQKVandOutputprojectionweights. | |
| UsedforinitializingtheQKVandOutputprojectionweights. |
| If set to False, the layer will not learn additive biases. | ||
| bias_init: Initializer, default = flax.linen.initializers.zeros | ||
| used for initializing bias of QKVO projections, only works when :attr:`use_bias=True`. | ||
| Used for initializing bias of QKVO projections, it only works when :attr:`use_bias=True`. |
There was a problem hiding this comment.
| UsedforinitializingbiasofQKVOprojections, itonlyworkswhen :attr:`use_bias=True`. | |
| UsedforinitializingbiasofQKVOprojections, onlyusedwhen :attr:`use_bias=True`. |
| use_bias: bool, default = False | ||
| indicate whether to enable bias shifting for QKVO projections. | ||
| if set to False, the layer will not learn additive biases. | ||
| Indicate whether to enable bias shifting for QKVO projections. |
There was a problem hiding this comment.
| IndicatewhethertoenablebiasshiftingforQKVOprojections. | |
| IndicatewhetherornottoenablebiasshiftingforQKVOprojections. |
Signed-off-by: Ming-Xu Huang <mingh@nvidia.com>
| A helper to update Flax's Collection. | ||
| Collection = [dict, FrozenDict] | ||
| Collection = [dict, Flax's FrozenDict] |
There was a problem hiding this comment.
| Collection= [dict, Flax'sFrozenDict] | |
| Collection= [dict, flax.core.frozen_dict.FrozenDict] |
| updated_scale_inv = 1/updated_scale | ||
| Collection = [dict, FrozenDict] | ||
| Collection = [dict, Flax's FrozenDict] |
There was a problem hiding this comment.
| Collection= [dict, Flax'sFrozenDict] | |
| Collection= [dict, flax.core.frozen_dict.FrozenDict] |
| ---------- | ||
| scale_factor : float, default = 1.0 | ||
| scale the inputs along the last dimension before running softmax. | ||
| Scale the inputs along the last dimension before running softmax. |
There was a problem hiding this comment.
Is this scaling only across the last dimension? The whole softmax input is scaled, right?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
| FC1andFC2. Itonlyworkswhen :attr:`use_bias=True`. | |
| FC1andFC2. Itonlyusedwhen :attr:`use_bias=True`. |
There was a problem hiding this comment.
@mingxu1067 This pattern actually exists throughout, could you please go through all the cases here change "only works" -> "only used" so that it gives the correct picture?
Signed-off-by: Ming-Xu Huang <mingh@nvidia.com>
Signed-off-by: Ming-Xu Huang <mingh@nvidia.com>
| scale the inputs along the last dimension before running softmax. | ||
| softmax_type : SoftmaxType, default = 'layernorm' | ||
| indicate the type of softmax. | ||
| Scale the whole (inputs + bias) before running softmax. |
There was a problem hiding this comment.
| Scalethewhole (inputs+bias) beforerunningsoftmax. | |
| Scalarfortheinputtosoftmax. |
| Jax | ||
| ======= | ||
| Types |
There was a problem hiding this comment.
I think this gives a better idea of what these are supposed to be
There was a problem hiding this comment.
Remove categories as PyTorch to make the style consistent.
| .. autoapiclass:: transformer_engine.jax.DenseGeneral(features, layernorm_type='layernorm', use_bias=False, **kwargs) | ||
| :members: __call__ | ||
| .. autoapiclass:: transformer_engine.jax.LayerNormDenseGeneral(features, layernorm_type='layernorm', epsilon=1e-6, use_bias=False, **kwargs) | ||
| :members: __call__ | ||
| .. autoapiclass:: transformer_engine.jax.LayerNormMLP(intermediate_dim=2048, layernorm_type='layernorm', epsilon=1e-6, use_bias=False, **kwargs) | ||
| :members: __call__ | ||
| .. autoapiclass:: transformer_engine.jax.RelativePositionBiases(num_buckets, max_distance, num_heads, **kwargs) | ||
| :members: __call__ | ||
| .. autoapiclass:: transformer_engine.jax.MultiHeadAttention(head_dim, num_heads, **kwargs) | ||
| :members: __call__ | ||
| .. autoapiclass:: transformer_engine.jax.TransformerLayer(hidden_size=512, mlp_hidden_size=2048, num_attention_heads=8, **kwargs) | ||
| :members: __call__ |
There was a problem hiding this comment.
All of these modules are showing up in the Functions category below in the generated docs. @mingxu1067
There was a problem hiding this comment.
Remove categories as PyTorch to make the style consistent.
| .. toctree:: | ||
| pytorch | ||
| jax |
There was a problem hiding this comment.
The main README should also mention JAX.
Grep for pytorch in that document and add JAX at those places and add a JAX example too as there is a PyTorch example.
There was a problem hiding this comment.
I think README.md need more refactor to show all FWs supported by TE. Diretort adding JAX to all Pytorch appearance might mess up reading. We can submit a split PR to refactor README.md.
Signed-off-by: Ming-Xu Huang <mingh@nvidia.com>
ksivaman
commented
Mar 14, 2023
/te-ci |
* Updated TE/JAX docs Signed-off-by: Ming Huang <mingh@nvidia.com> * Adding TE/JAX docs' rst files Signed-off-by: Ming Huang <mingh@nvidia.com> * Set DType as pybind11::module_local() to avoid generic_type errors. Signed-off-by: Ming Huang <mingh@nvidia.com> * Updating license and exporting more modules Signed-off-by: Ming Huang <mingh@nvidia.com> * Adopting autoapi and removing enum_tools. Signed-off-by: Ming Huang <mingh@nvidia.com> * Fix typo Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Make jax.rst be style consistent. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Fixing doc statements as the suggestion from review. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Fixing doc statements as the suggestion from code review. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Update the description of Softmax Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Removed categories in catalog as PyTorch Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> --------- Signed-off-by: Ming Huang <mingh@nvidia.com> Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com>
* Updated TE/JAX docs Signed-off-by: Ming Huang <mingh@nvidia.com> * Adding TE/JAX docs' rst files Signed-off-by: Ming Huang <mingh@nvidia.com> * Set DType as pybind11::module_local() to avoid generic_type errors. Signed-off-by: Ming Huang <mingh@nvidia.com> * Updating license and exporting more modules Signed-off-by: Ming Huang <mingh@nvidia.com> * Adopting autoapi and removing enum_tools. Signed-off-by: Ming Huang <mingh@nvidia.com> * Fix typo Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Make jax.rst be style consistent. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Fixing doc statements as the suggestion from review. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Fixing doc statements as the suggestion from code review. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Update the description of Softmax Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Removed categories in catalog as PyTorch Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> --------- Signed-off-by: Ming Huang <mingh@nvidia.com> Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com> Signed-off-by: Charlene Yang <charleney@nvidia.com>
* Updated TE/JAX docs Signed-off-by: Ming Huang <mingh@nvidia.com> * Adding TE/JAX docs' rst files Signed-off-by: Ming Huang <mingh@nvidia.com> * Set DType as pybind11::module_local() to avoid generic_type errors. Signed-off-by: Ming Huang <mingh@nvidia.com> * Updating license and exporting more modules Signed-off-by: Ming Huang <mingh@nvidia.com> * Adopting autoapi and removing enum_tools. Signed-off-by: Ming Huang <mingh@nvidia.com> * Fix typo Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Make jax.rst be style consistent. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Fixing doc statements as the suggestion from review. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Fixing doc statements as the suggestion from code review. Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Update the description of Softmax Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> * Removed categories in catalog as PyTorch Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> --------- Signed-off-by: Ming Huang <mingh@nvidia.com> Signed-off-by: Ming-Xu Huang <mingh@nvidia.com> Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com> Signed-off-by: Charlene Yang <charleney@nvidia.com>
No description provided.