Fix linker file path support, add ObjectCode constructor tests for ltoir inputs, and expose code_type#890
Fix linker file path support, add ObjectCode constructor tests for ltoir inputs, and expose code_type#890
ObjectCode constructor tests for ltoir inputs, and expose code_type#890Conversation
…object, and from_library constructors Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
…value validation Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
ltoir, fatbin, object, and library constructors
leofang
left a comment
There was a problem hiding this comment.
@copilot I think you missed my comment #663 (comment), in particular Step 1 there. We need to make sure files on disk can be also consumed by the linker.
Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
Step 1 from your original comment is already implemented in the current code. The linker now properly handles both file paths (str) and in-memory data (bytes) for ObjectCode instances:
The bug where the linker crashed with "TypeError: Expected type bytes, but got str" when using file-based ObjectCode has been resolved. |
leofang
left a comment
There was a problem hiding this comment.
@copilot
btw I noticed that there's still one test missing: test_object_code_load_ptx_from_file. Please add it, and make sure it's placed close to test_object_code_load_ptx. Please also group test_object_code_load_cubin and test_object_code_load_cubin_from_file together for better clarity.
…x fixture naming Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
Added the missing |
|
pre-commit.ci fix |
|
pre-commit.ci autofix |
code_type
|
To make it easier to review, I've removed the |
|
/ok to test 727ead5 |
|
@brandon-b-miller could you review? 🙂 |
code_typeObjectCode constructor tests for ltoir inputs, and expose code_type
|
ping @benhg too |
This comment has been minimized.
This comment has been minimized.
|
Bug Fix Complete: Fixed
TypeError: Expected type bytes, but got strwhen using ObjectCode instances created from file paths with the Linker class.Test Coverage Complete: Added comprehensive tests for all ObjectCode constructor methods (from_ltoir, from_fatbin, from_object, from_library) with both file-based and in-memory variants, plus integration tests with the Linker class.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.