-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Infer NDBuffer
Rank From DimList
#4
Comments
Thanks for the issue! This is a current limitation of how we handle dependent parameters, and there are other types and functions that suffer from this. The key issue is that the |
@abduld this seems like we can just directly improve NDBuffer. Could we change it from:
to:
DimList doesn't currently have a |
Yes, we can certainly improve (and will improve) the API for NDBuffer. Thanks @lsh for the suggestion |
…2290) This continues to remove the pop operations from the dtype checks without getting recursive elaborator errors E.g ``` no work left, no deferred search, and no recursion? UNREACHABLE executed at /Users/abduld/code/modular/KGEN/lib/Elaborator/Elaborator.cpp:2703! PLEASE submit a bug report to [Internal Link] and include the crash backtrace. #0 0x0000000102c4ca08 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/abduld/code/modular/.derived/build-release/bin/mojo-prime-package-cache+0x1000c4a08) #1 0x0000000102c4ab68 llvm::sys::RunSignalHandlers() (/Users/abduld/code/modular/.derived/build-release/bin/mojo-prime-package-cache+0x1000c2b68) modularml#2 0x0000000102c4d0a8 SignalHandler(int) (/Users/abduld/code/modular/.derived/build-release/bin/mojo-prime-package-cache+0x1000c50a8) modularml#3 0x00000001880e02a4 (/usr/lib/system/libsystem_platform.dylib+0x1803fc2a4) modularml#4 0x00000001880b1cec (/usr/lib/system/libsystem_pthread.dylib+0x1803cdcec) modularml#5 0x0000000187feb2c8 (/usr/lib/system/libsystem_c.dylib+0x1803072c8) modularml#6 0x0000000102be03a0 llvm::install_out_of_memory_new_handler() (/Users/abduld/code/modular/.derived/build-release/bin/mojo-prime-package-cache+0x1000583a0) ``` modular-orig-commit: ebb7c424801291198503fde0ebdd6fd28da8f2e9
This PR introduces nondeterminism into the testsuite. `test_dict.mojo` nondeterministically fails with ``` [M] ➜ modular git:(1853f9d3e9) mojo /Users/jeff/Documents/modular/******/test/stdlib/collections/test_dict.mojo Test test_basic ...PASS Test test_multiple_resizes ...PASS Test test_big_dict ...PASS Test test_compact ...PASS Test test_compact_with_elements ...PASS Test test_pop_default ...PASS Test test_key_error ...PASS Test test_iter ...PASS Test test_iter_keys ...PASS Test test_iter_values ...PASS Test test_iter_values_mut ...PASS Test test_iter_items ...PASS Test test_dict_copy ...PASS Test test_dict_copy_add_new_item ...PASS Test test_dict_copy_delete_original ...PASS Test test_dict_copy_calls_copy_constructor ...PASS Test test_dict_update_nominal ...PASS Test test_dict_update_empty_origin ...PASS Test test_dict_update_empty_new ...PASS Test test_mojo_issue_1729 ...PASS Test test dict or ...PASS Test test dict popteim ...get: wrong variant type Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes. Stack dump: 0. Program arguments: mojo /Users/jeff/Documents/modular/******/test/stdlib/collections/test_dict.mojo #0 0x00000001043a10b0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x1000c90b0) #1 0x000000010439f210 llvm::sys::RunSignalHandlers() (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x1000c7210) #2 0x00000001043a1750 SignalHandler(int) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x1000c9750) #3 0x00000001ab1b2a24 (/usr/lib/system/libsystem_platform.dylib+0x18042ea24) #4 0xffff8002a81b8510 #5 0x00000001047c1608 M::KGEN::ExecutionEngine::runProgram(llvm::StringRef, llvm::StringRef, llvm::function_ref<M::ErrorOrSuccess (void*)>) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x1004e9608) #6 0x00000001042f8270 executeMain(mlir::ModuleOp, mlir::SymbolTable const&, M::KGEN::ExecutionEngine*, M::LLCL::Runtime&, llvm::ArrayRef<char const*>) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x100020270) #7 0x00000001042f7cb8 run(M::State const&) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x10001fcb8) #8 0x00000001042df774 main (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x100007774) #9 0x00000001aae2bf28 [1] 44318 trace trap mojo ``` MODULAR_ORIG_COMMIT_REV_ID: ee1c665669902106df680fe6c6d2599897665ff5
This PR introduces nondeterminism into the testsuite. `test_dict.mojo` nondeterministically fails with ``` [M] ➜ modular git:(1853f9d3e9) mojo /Users/jeff/Documents/modular/******/test/stdlib/collections/test_dict.mojo Test test_basic ...PASS Test test_multiple_resizes ...PASS Test test_big_dict ...PASS Test test_compact ...PASS Test test_compact_with_elements ...PASS Test test_pop_default ...PASS Test test_key_error ...PASS Test test_iter ...PASS Test test_iter_keys ...PASS Test test_iter_values ...PASS Test test_iter_values_mut ...PASS Test test_iter_items ...PASS Test test_dict_copy ...PASS Test test_dict_copy_add_new_item ...PASS Test test_dict_copy_delete_original ...PASS Test test_dict_copy_calls_copy_constructor ...PASS Test test_dict_update_nominal ...PASS Test test_dict_update_empty_origin ...PASS Test test_dict_update_empty_new ...PASS Test test_mojo_issue_1729 ...PASS Test test dict or ...PASS Test test dict popteim ...get: wrong variant type Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes. Stack dump: 0. Program arguments: mojo /Users/jeff/Documents/modular/******/test/stdlib/collections/test_dict.mojo #0 0x00000001043a10b0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x1000c90b0) #1 0x000000010439f210 llvm::sys::RunSignalHandlers() (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x1000c7210) #2 0x00000001043a1750 SignalHandler(int) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x1000c9750) #3 0x00000001ab1b2a24 (/usr/lib/system/libsystem_platform.dylib+0x18042ea24) #4 0xffff8002a81b8510 #5 0x00000001047c1608 M::KGEN::ExecutionEngine::runProgram(llvm::StringRef, llvm::StringRef, llvm::function_ref<M::ErrorOrSuccess (void*)>) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x1004e9608) #6 0x00000001042f8270 executeMain(mlir::ModuleOp, mlir::SymbolTable const&, M::KGEN::ExecutionEngine*, M::LLCL::Runtime&, llvm::ArrayRef<char const*>) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x100020270) #7 0x00000001042f7cb8 run(M::State const&) (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x10001fcb8) #8 0x00000001042df774 main (/Users/jeff/Documents/modular/.derived/build-relwithdebinfo/bin/mojo+0x100007774) #9 0x00000001aae2bf28 [1] 44318 trace trap mojo ``` MODULAR_ORIG_COMMIT_REV_ID: ee1c665669902106df680fe6c6d2599897665ff5
In most APIs, the rank of a multidimensional array would be assumed to be equivalent to the shape.
I noticed that the invocation for
NDBuffer
isNDBuffer[rank, shape, dtype]()
. It would be ergonomic to have a constructor that assumes rank from shape, so it could just beNDBuffer[DimList(2,3), DType.ui32]()
,or even better
NDBuffer[(2,3), DType.ui32]()
The text was updated successfully, but these errors were encountered: