Skip to content

Commit

Permalink
Add warnings and fallback for unassigned devices in infer_auto_device…
Browse files Browse the repository at this point in the history
…_map (#3066)

* feat: feat: Add warning for unassigned main devices

* refactor: Improve warning for unassigned main devices

* feat: impl fallback_allocate; fix output format

* fix: include last dot index in the iteration

* feat: incorporate fallback allocation into infer_auto_device_map

* Revert "feat: incorporate fallback allocation into infer_auto_device_map"

This reverts commit d607bfb.

* refactor: add helper functions and eliminate redundant variables

The fallback allocation will be reintroduced once the branching logic is fully refactored. This commit prepares the function infer_auto_device_map for further refactoring.

* refactor: simplify allocation logic by removing duplicates and reducing nesting

* feat: incorporate fallback allocation into infer_auto_device_map

Implemented fallback allocation to allow modules to be allocated to devices using BFS when regular allocation fails. This enhancement improves the allocation process by ensuring that at least one module is assigned to the device, even under tight memory constraints.

* fix: fix module splitting logic

* styles: fix styling errors

* test: add test coverage for no-warning cases

test_infer_auto_device_map and test_infer_auto_device_map_with_fallback_allocation now each have a no-warning test case.

Simplified and rewrote code sections that were made unreadable by the linter.

* refactor: simplify control flow in infer_auto_device_map

Added complete return type hinting for _init_infer_auto_device_map

* refactor: replace warnings.warn with logger.info for allocation failures

* fix: use assertLogs to capture no allocation warning messages correctly
  • Loading branch information
Nech-C authored Nov 20, 2024
1 parent 8ad2b3b commit d7b1b36
Show file tree
Hide file tree
Showing 2 changed files with 490 additions and 148 deletions.
Loading

0 comments on commit d7b1b36

Please sign in to comment.