This document describes the Canonical Genetic Algorithm (CanonicalGA) implementation for chiplet technology assignment in ChipletPart.
The Canonical Genetic Algorithm is now fully implemented and operational! The string creation bug (basic_string::_M_create error) has been fixed by implementing safer string handling throughout the codebase. The fix includes:
- Safe string copying using c_str() to create proper memory-managed string copies
- Pre-allocation of memory with reserve() to avoid reallocation failures
- Extra validation for string operations and proper error handling
- Guards against empty strings and null references
The full CanonicalGA implementation includes:
- Advanced genetic algorithm that optimizes technology assignments for chiplets
- Canonicalization of technology assignments to avoid redundant evaluations
- Fitness caching for efficient evaluation and faster convergence
- Customizable genetic operators (crossover, mutation)
- Support for variable numbers of chiplets
- Integration with cost models for full evaluation
You can run the canonical GA mode using the provided scripts:
# Using the test script with a specific test case
./run_chiplet_test.sh ga100 --canonical-ga --tech-nodes 7nm,14nm,28nm
# Using the dedicated canonical GA script
./run_canonical_ga.sh --tech-nodes 7nm,14nm,28nmYou can customize the genetic algorithm parameters:
./run_canonical_ga.sh --tech-nodes 7nm,14nm,28nm --generations 50 --population 50The canonical GA generates the following output files:
canonical_ga_result.parts.N- Partition assignments (where N is the number of chiplets)canonical_ga_result.techs.N- Technology assignments for each chipletcanonical_ga_result.summary.txt- Summary of the partition and technology assignments
- String creation error: FIXED - The
basic_string::_M_createerror that was previously occurring in the CanonicalGA implementation has been fixed by implementing safer string handling throughout the codebase.
- Add detailed statistics and visualizations for the genetic algorithm progress
- Improve the integration with the cost models for technology evaluation
- Expand the test suite with more comprehensive tests for the genetic algorithm
- Add support for additional optimization criteria and constraints