Skip to content

Tests - Add test cases for pre-process modules in GPT-like models to numerical tests#76

Open
yzygitzh wants to merge 1 commit into
devfrom
ziyue/pr-numerical-test-modules-pre-process
Open

Tests - Add test cases for pre-process modules in GPT-like models to numerical tests#76
yzygitzh wants to merge 1 commit into
devfrom
ziyue/pr-numerical-test-modules-pre-process

Conversation

@yzygitzh

Copy link
Copy Markdown
Contributor

Adds test cases for pre-process modules in GPT-like models to numerical tests. Including:

  • Embedding layer.

@yzygitzh yzygitzh requested a review from a team as a code owner July 26, 2025 08:08
@yzygitzh yzygitzh added the CI/CD label Jul 26, 2025
@yzygitzh yzygitzh requested a review from Copilot July 28, 2025 03:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds numerical test coverage for the embedding layer component of GPT-like models by introducing a new test file for the LanguageModelEmbedding module. The test validates the embedding layer's forward and backward passes through multiple training steps.

  • Adds comprehensive test case for LanguageModelEmbedding with parameterized configurations
  • Tests embedding layer with RoPE position embeddings and various model configurations
  • Implements multi-step training loop to verify gradient computation and parameter updates
Comments suppressed due to low confidence (2)

tests/numerical_tests/modules/test_embedding.py:27

  • The test only covers a single attention head configuration. Consider adding test cases with multiple attention heads to ensure the embedding layer works correctly with different model architectures.
            'num_attention_heads': 1,

tests/numerical_tests/modules/test_embedding.py:35

  • The test only covers RoPE position embeddings. Consider adding test cases for other position embedding types (e.g., 'learned', 'alibi') to ensure comprehensive coverage of the embedding layer's position encoding functionality.
            'position_embedding_type': 'rope',

Comment thread tests/numerical_tests/modules/test_embedding.py
@cp5555

cp5555 commented Jul 28, 2025

Copy link
Copy Markdown

Change the title "Tests - Add test cases for embedding layer in transformer-based models."

)
output = model(*inputs)
loss = output.mean()
loss.backward()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Will parameters of embedding layer be changed? I think it should be no?

from tests.numerical_tests.modules.test_module import TestModule


class TestLanguageModelEmbedding(TestModule):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

seems this test is not enabled in current pipeline?

@github-actions

Copy link
Copy Markdown

Marking as stale. No activity in 60 days.

@github-actions github-actions Bot added the stale label Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants