Skip to content

Conversation

@eugenebokhan
Copy link
Contributor

No description provided.

eugenebokhan and others added 30 commits March 26, 2025 11:29
…band part operations

Implemented the MPSGraphLinearAlgebraOps API, adding support for:
- Band part operations to extract diagonal bands from matrices
- Matrix inverse operations via LU decomposition
- Hamming distance calculation
- Scaled dot product attention for transformer models

Includes tests and an example demonstrating the usage of these operations.
Updated implementation plan to mark linear algebra operations as completed.
Implemented two important convolution operation types:
1. Transposed Convolution (Deconvolution) - for upsampling operations
2. Depthwise Convolution - for efficient channel-wise convolutions

Added support for:
- 2D and 3D depthwise convolutions
- Forward pass and gradient operations for both
- Configurable descriptors for padding, strides, dilations
- Support for different data layouts

Includes unit tests and an example demonstrating both types of convolutions.
Updated implementation plan to mark advanced convolution operations as completed.
- Add detailed memory characteristics for NSString, NSData, and collections
- Document NSMutableData, NSMutableArray and NSMutableDictionary usage
- Add examples of using the ClassType trait and declare macros
- Include additional Foundation types like NSNumber, NSRange, and NSValue
- Expand best practices section with objc2-foundation specifics

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
* Added implementation for MPSGraphCompilationDescriptor and MPSGraphExecutionDescriptor
* Updated MPSGraph to use the new descriptors for compilation and execution
* Added async execution methods to MPSGraph
* Added unit tests for the new functionality
* Updated dependencies and re-exports in lib.rs
* Added a simple example using the descriptors
- Mark MPSGraphMemoryOps.h as fully implemented
- Detailed implementation status for arithmetic, pooling, and reduction operations
- Provide specific action items for each pending module
- Update main summary to reflect latest progress

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create a full implementation of arithmetic operations in arithmetic_ops.rs
- Implement all unary operations (identity, exp, log, trigonometric functions, etc.)
- Implement all binary operations (add, subtract, multiply, divide, comparisons, etc.)
- Implement ternary operations (select, clamp)
- Implement complex number operations
- Ensure proper memory management with objc_retain/objc_release
- Update TODO.md to reflect the implementation status

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create a comprehensive implementation of pooling operations in pooling_ops.rs
- Implement descriptor types: MPSGraphPooling2DOpDescriptor and MPSGraphPooling4DOpDescriptor
- Implement all 2D operations: max_pooling_2d, avg_pooling_2d, l2_norm_pooling_2d
- Implement all 4D operations: max_pooling_4d, avg_pooling_4d, l2_norm_pooling_4d
- Implement operations that return indices: max_pooling_2d_return_indices, max_pooling_4d_return_indices
- Implement all gradient operations for 2D and 4D pooling
- Add proper memory management with objc_retain/objc_release
- Update TODO.md to reflect implementation status

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Create a comprehensive implementation of reduction operations in reduction_ops.rs
- Implement basic operations: sum, minimum, maximum, product with single-axis and multi-axes variants
- Implement NaN-handling operations with propagate NaN variants
- Implement logical operations: AND, OR, XOR
- Implement argmax/argmin operations
- Add proper memory management with objc_retain/objc_release
- Update TODO.md to reflect that all major components are now implemented

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix duplicate tanh function by renaming to tanh_arithmetic in arithmetic_ops.rs
- Remove unused imports across multiple files
- Fix unclosed delimiter in convolution_ops.rs
- Fix variable declaration in graph.rs
- Fix camel case enum variants in pooling_ops.rs
- Remove unnecessary unsafe blocks
- Fix warning in matmul example

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add commas between arguments in msg_send\! macros
- Fix deprecated syntax warnings

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
eugenebokhan and others added 28 commits March 29, 2025 10:47
…eue_results_dict

- Updated all execution methods to use run_async_with_command_queue_results_dict
- Fixed parameter order for this method (command_queue, feeds, target_ops, results_dict, descriptor)
- Successfully demonstrated direct computation into pre-allocated Metal buffers
- Achieved correct results for all computation stages
- Added explanatory notes about using pre-allocated buffers with MPSGraph

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Reorganized code into logical sections with clear comments
- Created all buffers and tensor data upfront
- Built a complete graph with three operations (add, multiply, add)
- Used synchronous execution for simplicity and reliability
- Added result verification with expected values
- Improved documentation and visual formatting of console output

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add MPSCommandBuffer wrapper class with memory management
- Update MPSGraph to use MPSCommandBuffer for encoding
- Update MPSGraphExecutable to support MPSCommandBuffer
- Update simple_compile.rs to use MPSCommandBuffer instead of regular command buffer
- Fix error handling to use String instead of NSError for better compatibility
- Cleanup examples to keep only matmul.rs and simple_compile.rs
- Added proper delegation to underlying MTLCommandBuffer for various methods
- Fixed GPU timing methods to properly fetch from underlying command buffer
- Updated simple_compile example for compatibility
- Enabled doctests by removing 'doctest = false' from mpsgraph Cargo.toml
- Fixed pseudocode examples to use text language tag
- Updated examples to use MPSShape::from_slice properly
- Fixed function signatures and parameter types in examples
- Ensured all examples are properly formatted and consistent

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
commit 97708c3
Author: eugene <eugenebokhan@icloud.com>
Date:   Mon Mar 31 18:59:07 2025 +0100

    fix warnings

commit dc72b56
Author: eugene <eugenebokhan@icloud.com>
Date:   Mon Mar 31 18:03:06 2025 +0100

    working tests

commit 62bf86e
Author: eugene <eugenebokhan@icloud.com>
Date:   Mon Mar 31 16:32:20 2025 +0100

    add tests
@eugenebokhan eugenebokhan merged commit 9a6dca5 into main Mar 31, 2025
1 check passed
@eugenebokhan eugenebokhan deleted the add-sources branch March 31, 2025 21:31
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.

2 participants