Skip to content

Conversation

@Breman402
Copy link
Collaborator

Description

This PR closes multiple issues. See closes.

Adds: BLAS implementation that can be used similar to the AVX versions
Adds: New model to test imagenet against

Removes: flipping the kernel
Remoces: duplicate code

Issue

Closes #216 #215 #214 #213

@Breman402 Breman402 requested review from Copilot and ehmc123 April 25, 2025 12:50
@Breman402 Breman402 self-assigned this Apr 25, 2025
Copy link
Contributor

Copilot AI left a comment

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 a new BLAS GEMM implementation and a Global Average Pool node while also refactoring testing code for improved clarity and maintainability. Key changes include:

  • Adding a new BLAS GEMM branch (using OpenBLAS) and its corresponding code paths.
  • Introducing a GlobalAveragePool node and integrating it into the parser.
  • Refactoring test files for image preprocessing and inference (renaming tests and removing kernel flipping code).

Reviewed Changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_image_to_guess.cpp Refactored image preprocessing/inference tests using new helpers.
tests/test_ImageNet.cpp Updated tests with a new default parameter for model JSON path and clearer test names.
src/nodes/global_avg_pool.cpp Added implementation of the Global Average Pool node.
src/nodes/conv.cpp Removed the kernel flipping functionality as intended.
src/include/nodes/global_avg_pool.hpp Added the header for the Global Average Pool node.
src/include/nodes/conv.hpp Removed obsolete flip_kernel declaration.
src/datastructures/tensor_operations_module.tpp Introduced a new branch for BLAS-based GEMM.
src/datastructures/tensor_operation_functions.tpp Added OpenBLAS GEMM implementation and required includes.
src/backend/mml_parser.cpp Integrated GlobalAveragePool node support in the parser.
Files not reviewed (3)
  • CMakeLists.txt: Language not supported
  • Makefile: Language not supported
  • src/include/modularml: Language not supported
Comments suppressed due to low confidence (1)

src/nodes/global_avg_pool.cpp:94

  • [nitpick] Consider clarifying or removing the ambiguous 'FIX' comment since a clearly named array_mml (in_index) is already used for indexing, to improve code readability.
// *** FIX: use a named array_mml to index ***

@Breman402 Breman402 changed the title Add feature: BLAS GEMM Add Feature: BLAS GEMM Apr 25, 2025
@Breman402 Breman402 enabled auto-merge April 25, 2025 16:54
Copy link
Collaborator

@GillisC GillisC left a comment

Choose a reason for hiding this comment

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

LGTM

@Breman402 Breman402 merged commit 8b8c34c into main May 1, 2025
3 of 4 checks passed
@Breman402 Breman402 deleted the feature/BLAS-conv-node branch May 13, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants