You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add upload_file and download_file support
to MultiProcessPssh with operation registry
This commit addresses API incompatibility issues between Pssh and MultiProcessPssh
classes and implements a robust operation registry system to prevent future drift.
Key Changes:
- Add missing upload_file and download_file methods to MultiProcessPssh class
- Implement operation registry (SUPPORTED_OPERATIONS) as single source of truth
- Use method names directly as operation names to eliminate mapping errors
- Add missing detailed parameter support to MultiProcessPssh.exec()
API Parity Testing:
- Add comprehensive test suite to catch missing methods automatically
- Validate method signatures match between Pssh and MultiProcessPssh
- Verify operation registry completeness and consistency
- Test runtime execution of all sharder operations with proper parameters
Operations Updated:
- exec -> exec (added detailed parameter support)
- upload_file -> upload_file (new operation, matches method name)
- download_file -> download_file (new operation, matches method name)
This ensures MultiProcessPssh maintains full API compatibility with Pssh
and prevents the class of issues that led to missing upload_file/download_file methods.
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Ignatious Johnson <ichristo@amd.com>
* Refactor to ABC + composition + dynamic sharder architecture
This commit addresses all PR review comments by completely refactoring
the multiprocess SSH architecture to be cleaner, more maintainable, and
more robust.
Key Architectural Changes:
- Replace inheritance with ABC + composition pattern
- Eliminate registry + if/elif tree with dynamic method dispatch
- Create single source of truth via ShardableSshInterface ABC
- Move ABC to separate interfaces.py to avoid circular imports
Review Comments Addressed:
- #1-#2: Fixed operation name mismatches (upload/download)
- #3: Updated test expectations for new calling convention
- #4: Proper error handling with early ABC validation
- #5: Maintained custom download_file result merging
- #6: Implemented exact dynamic approach suggested by reviewer
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Ignatious Johnson <ichristo@amd.com>
---------
Signed-off-by: Ignatious Johnson <ichristo@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
All rights reserved. This notice is intended as a precaution against inadvertent publication and does not imply publication or any waiver of confidentiality.
4
+
The year included in the foregoing notice is the year of creation of the work.
5
+
All code contained here is Property of Advanced Micro Devices, Inc.
6
+
'''
7
+
8
+
fromabcimportABC, abstractmethod
9
+
10
+
11
+
classShardableSshInterface(ABC):
12
+
"""Abstract base class defining operations that MUST support sharding.
13
+
14
+
Any class implementing this interface must provide sharded implementations
15
+
for all these methods. This prevents silent performance degradation where
16
+
operations fall back to non-sharded implementations.
0 commit comments