Skip to content

Test/transformer model#21

Merged
JacobBorden merged 2 commits intodevelopmentfrom
test/transformer-model
May 31, 2025
Merged

Test/transformer model#21
JacobBorden merged 2 commits intodevelopmentfrom
test/transformer-model

Conversation

@JacobBorden
Copy link
Owner

No description provided.

… done so far and provide feedback for Jules to continue.
This commit introduces a suite of unit tests for the TransformerModel class, located in `tests/test_transformer_model.cpp`.

The tests cover:
- Default constructor behavior.
- Initialization of the model with specified parameters.
- Basic forward pass functionality, ensuring output is generated without errors.
- Handling of invalid inputs, such as empty sequences or sequences exceeding the maximum defined length.

The `tests/CMakeLists.txt` file has been updated to include the new test file in the `runTests` executable.

During the process, I identified and resolved various compilation, linking, and runtime issues. These included namespace corrections, proper initialization of model and matrix objects within the tests, adding missing source files (`src/transformer/transformer_model.cpp`) to the main library target in `src/CMakeLists.txt` (which I took care of, but it's important to note), and resolving `std::` namespace ambiguities in `transformer_model.cpp` by removing an unused `<iomanip>` include and explicitly qualifying types like `std::vector` and `std::string`. I also corrected attention mask dimensions in the `ForwardPassBasic` test.
@JacobBorden JacobBorden merged commit d3603d6 into development May 31, 2025
1 of 2 checks passed
@JacobBorden JacobBorden deleted the test/transformer-model branch May 31, 2025 11:20
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.

1 participant