Skip to content

Conversation

@WaterMenon09
Copy link
Contributor

@WaterMenon09 WaterMenon09 commented Sep 12, 2025

Enhanced Mobility Robustness Optimization (MRO) Module

Summary

Enhanced the Mobility Robustness Optimization (MRO) module with comprehensive improvements including a new Bayesian optimization approach, improved logging infrastructure, better documentation, and refined cell attachment logic.

Key Changes

  • Added new BayesianMRO class implementing GPR and XGBoost optimization for hysteresis and TTT parameter tuning
  • Replaced print statements with structured logging throughout the codebase
  • Enhanced documentation with comprehensive docstrings across all MRO classes
  • Improved error handling and GPU acceleration support
  • Refined cell attachment logic with better hysteresis and TTT handling

Key Features

New Bayesian ML Optimization (mro_ml.py)

  • Implements Bayesian optimization using Gaussian Process Regression (GPR) or XGBoost as surrogate models
  • Appended Baysian optimization approach to the mro notebook for easy reproducability
  • Uses Expected Improvement (EI) acquisition function for efficient parameter space exploration
  • Supports both CPU and GPU acceleration via PyTorch
  • Provides systematic approach to finding optimal hysteresis and Time-to-Trigger parameters

Enhanced MRO Base Class

  • Logging Infrastructure: Replaced all print statements with structured logging using Python's logging module
  • GPU Support: Added CUDA device detection and model placement for improved performance
  • Better Error Handling: Enhanced exception handling with proper logging at different severity levels
  • Improved Cell Update Logic: Simplified _update() method by removing unnecessary kernel reconfiguration and jitter adjustments

Reinforcement Learning MRO Improvements (mro_rl.py)

  • Added comprehensive module-level and class-level documentation
  • Enhanced docstrings explaining the RL approach to MRO optimization
  • Improved simulation boundary detection using find_sim_boundary()
  • Better integration with the RADP library utilities

Documentation Enhancements

  • Added detailed docstrings for all public methods with parameter descriptions, return types, and examples
  • Included table-formatted examples showing expected data structures
  • Documented initialization parameters and their purposes
  • Added explanations of optimization approaches and algorithms

Technical Details

Dependencies

  • Added optional XGBoost support for Bayesian optimization
  • Enhanced PyTorch integration for GPU acceleration

Testing

  • Minor bug fixes for MRO testing suite
  • All existing tests continue to pass

tanzim10 and others added 21 commits October 1, 2024 13:24
Mobility model Param Regression and all code Black Formatter
* Fixed PR changes for params_regression

* Fixed Unittest for param_regression according to PR change

* Fixed the mobility notebook and radp_library file(PR changes done)

* Resolved test_param_regression unittest cases

* Updated Param Regression and radp library as instructed in the PR review

* Changed the scipy dependency to solve dependency error

* Changed how seed value works especially made it user friendly

* Refactored functions and changed the imports

* Resolved test_param_regression imports

* All Black Changes

* Added MRO code and test cases

* Modified requirements-dev.txt to include dotnev

* Changed the directory for mro from radp/digital_twin to apps

* Changed MRO app code according to main API design

* added _format_ue_data_and_topology method

* Refactored some MRO app code and moved helper codes to radp_library

* fixed mro_app and updated test

* fixed minor issue in mro_app

* added some of the test methods

* fixed naming issue

* updated minor issue

* added most test cases

* added test for training and prediction

* removed redundent code and comments

* Changed solve function and removed redundant codes

* Fixed recent CI issue for MRO Test cases

* Fixed bugs for MRO app

* MRO unittest bug fix

* Bug fix for MRO dataframe columns

* Refined MRO app with SimpleMRO and MRO_Using_RL implementations

* Fixed perform_attacchment unittest error

* MRO Final PR Fix (#5)

* added testcases for updated cell_selection

* blacked and moved rxpower function

* Added mro_test notebook to test the mro app

* solve issue found

* Refactored the example notebook for MRO

* Debugging Tanzim's workflow

* added notebook sequence

* rxpwr bypass init

* f1, f0 done

* added all preprocess funcs

* minor fix

* got dict

* update

* update

* fixed dict data

* cleaned nb

* added docstrings

* minor fix

* completed training from scratch

* added the solve bug fix

* added todo and fixed rl

* update

* fixed col constraint issue & missing cell info issue

* fixed dtype mismatch

* added new update bdt logic

* added old mro in parallel to new

* fixed jitter issue

* minor type hint fixes

* added update() docstring

* formatted no rxpwr simpleMRO nb

* added _update()

* added save and load bdt

save and load tested in nb

added save and load; tested

* enabled cuda and flexibility for rl, fixed simple print for simple, removed redundent code for jitter

* reapplied covarience

* updated tests

* refactored predictions

* temp mro & mro pr-fix nb updated

* get rid of unused func and tests

* mro_pr-fix nb updated for sanity check

* addded cartesian check and nb

* addded cartesian nb heading updated

* moved norm_cells cartesian_check add_cell_info to radp_lib

* mro nb skeleton updated

* final mro nb with mro_data.zip, gitignore nb/req.txt updated

* added tests for mro

* added radp library tests

* removed debugging nbs

* tests done, rebased & epochs reset

* added mro readme at root

---------






* MRO PR-fix Changes (#6)

* added testcases for updated cell_selection

* blacked and moved rxpower function

* Added mro_test notebook to test the mro app

* solve issue found

* Refactored the example notebook for MRO

* Debugging Tanzim's workflow

* added notebook sequence

* rxpwr bypass init

* f1, f0 done

* added all preprocess funcs

* minor fix

* got dict

* update

* update

* fixed dict data

* cleaned nb

* added docstrings

* minor fix

* completed training from scratch

* added the solve bug fix

* added todo and fixed rl

* update

* fixed col constraint issue & missing cell info issue

* fixed dtype mismatch

* added new update bdt logic

* added old mro in parallel to new

* fixed jitter issue

* minor type hint fixes

* added update() docstring

* formatted no rxpwr simpleMRO nb

* added _update()

* added save and load bdt

save and load tested in nb

added save and load; tested

* enabled cuda and flexibility for rl, fixed simple print for simple, removed redundent code for jitter

* reapplied covarience

* updated tests

* refactored predictions

* temp mro & mro pr-fix nb updated

* get rid of unused func and tests

* mro_pr-fix nb updated for sanity check

* addded cartesian check and nb

* addded cartesian nb heading updated

* moved norm_cells cartesian_check add_cell_info to radp_lib

* mro nb skeleton updated

* final mro nb with mro_data.zip, gitignore nb/req.txt updated

* added tests for mro

* added radp library tests

* removed debugging nbs

* tests done, rebased & epochs reset

* added mro readme at root

* update mr nb removing no rxpwr flow

* added plots

* Added typecasting and docstrings to radp_library.py

* final sanity checked for cosmetics changes

* fixed simple & rl mro constructor

* fixed mro typehints

* safe delete mro nb & zip

* re added mro nb & zip

* added plotly req

* fixed dict to Dict type

---------






---------

Co-authored-by: Menon Pranto <[email protected]>
Co-authored-by: Ahnaf Tanjid <[email protected]>
Co-authored-by: RafidUl-Karim <[email protected]>
Co-authored-by: Ahnaf19 <ahnaftanjid19@@google.com>
Co-authored-by: WaterMenon09 <[email protected]>
Co-authored-by: Lkishor123 <[email protected]>
* [v0.2]: SinrDB Bug Fix (lf-connectivity#25)

Co-authored-by: Lkishor123 <[email protected]>

* Traffic Demand Generation Suite (lf-connectivity#20)

* Fixed PR changes for params_regression

* Fixed Unittest for param_regression according to PR change

* Fixed the mobility notebook and radp_library file(PR changes done)

* Resolved test_param_regression unittest cases

* Updated Param Regression and radp library as instructed in the PR review

* Changed the scipy dependency to solve dependency error

* Changed how seed value works especially made it user friendly

* Refactored functions and changed the imports

* Resolved test_param_regression imports

* All Black Changes

* MRO  (#17) (#7)

* Fixed PR changes for params_regression

* Fixed Unittest for param_regression according to PR change

* Fixed the mobility notebook and radp_library file(PR changes done)

* Resolved test_param_regression unittest cases

* Updated Param Regression and radp library as instructed in the PR review

* Changed the scipy dependency to solve dependency error

* Changed how seed value works especially made it user friendly

* Refactored functions and changed the imports

* Resolved test_param_regression imports

* All Black Changes

* Added MRO code and test cases

* Modified requirements-dev.txt to include dotnev

* Changed the directory for mro from radp/digital_twin to apps

* Changed MRO app code according to main API design

* added _format_ue_data_and_topology method

* Refactored some MRO app code and moved helper codes to radp_library

* fixed mro_app and updated test

* fixed minor issue in mro_app

* added some of the test methods

* fixed naming issue

* updated minor issue

* added most test cases

* added test for training and prediction

* removed redundent code and comments

* Changed solve function and removed redundant codes

* Fixed recent CI issue for MRO Test cases

* Fixed bugs for MRO app

* MRO unittest bug fix

* Bug fix for MRO dataframe columns

* Refined MRO app with SimpleMRO and MRO_Using_RL implementations

* Fixed perform_attacchment unittest error

* MRO Final PR Fix (#5)

* added testcases for updated cell_selection

* blacked and moved rxpower function

* Added mro_test notebook to test the mro app

* solve issue found

* Refactored the example notebook for MRO

* Debugging Tanzim's workflow

* added notebook sequence

* rxpwr bypass init

* f1, f0 done

* added all preprocess funcs

* minor fix

* got dict

* update

* update

* fixed dict data

* cleaned nb

* added docstrings

* minor fix

* completed training from scratch

* added the solve bug fix

* added todo and fixed rl

* update

* fixed col constraint issue & missing cell info issue

* fixed dtype mismatch

* added new update bdt logic

* added old mro in parallel to new

* fixed jitter issue

* minor type hint fixes

* added update() docstring

* formatted no rxpwr simpleMRO nb

* added _update()

* added save and load bdt

save and load tested in nb

added save and load; tested

* enabled cuda and flexibility for rl, fixed simple print for simple, removed redundent code for jitter

* reapplied covarience

* updated tests

* refactored predictions

* temp mro & mro pr-fix nb updated

* get rid of unused func and tests

* mro_pr-fix nb updated for sanity check

* addded cartesian check and nb

* addded cartesian nb heading updated

* moved norm_cells cartesian_check add_cell_info to radp_lib

* mro nb skeleton updated

* final mro nb with mro_data.zip, gitignore nb/req.txt updated

* added tests for mro

* added radp library tests

* removed debugging nbs

* tests done, rebased & epochs reset

* added mro readme at root

---------






* MRO PR-fix Changes (#6)

* added testcases for updated cell_selection

* blacked and moved rxpower function

* Added mro_test notebook to test the mro app

* solve issue found

* Refactored the example notebook for MRO

* Debugging Tanzim's workflow

* added notebook sequence

* rxpwr bypass init

* f1, f0 done

* added all preprocess funcs

* minor fix

* got dict

* update

* update

* fixed dict data

* cleaned nb

* added docstrings

* minor fix

* completed training from scratch

* added the solve bug fix

* added todo and fixed rl

* update

* fixed col constraint issue & missing cell info issue

* fixed dtype mismatch

* added new update bdt logic

* added old mro in parallel to new

* fixed jitter issue

* minor type hint fixes

* added update() docstring

* formatted no rxpwr simpleMRO nb

* added _update()

* added save and load bdt

save and load tested in nb

added save and load; tested

* enabled cuda and flexibility for rl, fixed simple print for simple, removed redundent code for jitter

* reapplied covarience

* updated tests

* refactored predictions

* temp mro & mro pr-fix nb updated

* get rid of unused func and tests

* mro_pr-fix nb updated for sanity check

* addded cartesian check and nb

* addded cartesian nb heading updated

* moved norm_cells cartesian_check add_cell_info to radp_lib

* mro nb skeleton updated

* final mro nb with mro_data.zip, gitignore nb/req.txt updated

* added tests for mro

* added radp library tests

* removed debugging nbs

* tests done, rebased & epochs reset

* added mro readme at root

* update mr nb removing no rxpwr flow

* added plots

* Added typecasting and docstrings to radp_library.py

* final sanity checked for cosmetics changes

* fixed simple & rl mro constructor

* fixed mro typehints

* safe delete mro nb & zip

* re added mro nb & zip

* added plotly req

* fixed dict to Dict type

---------






---------

Co-authored-by: Menon Pranto <[email protected]>
Co-authored-by: Ahnaf Tanjid <[email protected]>
Co-authored-by: RafidUl-Karim <[email protected]>
Co-authored-by: Ahnaf19 <ahnaftanjid19@@google.com>

* [Traffic_Demand_Generation]: Inital Commit, contains placeholders for all functions as per release plan.

* Fixes:
1. Removed cell_txpwr_dbm from topology.csv config gen.
2. Fixed (create_dummy_params_if_missing flag) for spatial_params.json and time_params.json  not working.

* Added UT: test_traffic_demand_simulation, covers:
1. Input Validation & Edge Cases
2. Core Logic & Output Structur
3. Dependency Handling & Fallbacks
4. Orchestration
5. Specific Algorithm Behaviors

* [Traffic Load Gen]: Refactored Code

* Refactored: v0.3.1: Traffic Load

* updated TL dirs in tests

---------

Co-authored-by: Menon Pranto <[email protected]>
Co-authored-by: Ahnaf Tanjid <[email protected]>
Co-authored-by: RafidUl-Karim <[email protected]>
Co-authored-by: Ahnaf19 <ahnaftanjid19@@google.com>
Co-authored-by: Lkishor123 <[email protected]>

* v0.3.2: Energy Saving App (lf-connectivity#24)

* Energy Saving App

* energy reward updated with cco & reward sum bugfix

Signed-off-by: Ahnaf19 <[email protected]>

* added demo & updated visualization

Signed-off-by: WaterMenon <[email protected]>

* fixed import bug

Signed-off-by: WaterMenon <[email protected]>

* cleaned & renamed to energy savings
Signed-off-by: Ahnaf19 <[email protected]>

renamed to energy savings

Signed-off-by: Ahnaf19 <[email protected]>

* disabled legacy tests

---------

Signed-off-by: Ahnaf19 <[email protected]>
Signed-off-by: WaterMenon <[email protected]>
Co-authored-by: Ahnaf19 <[email protected]>
Co-authored-by: WaterMenon <[email protected]>

* v0.3.3: Load Balance App (lf-connectivity#22)

* Load Balance App

* added demo & convex hull visuals

* Fixed PR changes for params_regression

* Fixed Unittest for param_regression according to PR change

* Fixed the mobility notebook and radp_library file(PR changes done)

* Resolved test_param_regression unittest cases

* Updated Param Regression and radp library as instructed in the PR review

* Changed the scipy dependency to solve dependency error

* Changed how seed value works especially made it user friendly

* Refactored functions and changed the imports

* Resolved test_param_regression imports

* All Black Changes

* MRO  (#17) (#7)

* Fixed PR changes for params_regression

* Fixed Unittest for param_regression according to PR change

* Fixed the mobility notebook and radp_library file(PR changes done)

* Resolved test_param_regression unittest cases

* Updated Param Regression and radp library as instructed in the PR review

* Changed the scipy dependency to solve dependency error

* Changed how seed value works especially made it user friendly

* Refactored functions and changed the imports

* Resolved test_param_regression imports

* All Black Changes

* Added MRO code and test cases

* Modified requirements-dev.txt to include dotnev

* Changed the directory for mro from radp/digital_twin to apps

* Changed MRO app code according to main API design

* added _format_ue_data_and_topology method

* Refactored some MRO app code and moved helper codes to radp_library

* fixed mro_app and updated test

* fixed minor issue in mro_app

* added some of the test methods

* fixed naming issue

* updated minor issue

* added most test cases

* added test for training and prediction

* removed redundent code and comments

* Changed solve function and removed redundant codes

* Fixed recent CI issue for MRO Test cases

* Fixed bugs for MRO app

* MRO unittest bug fix

* Bug fix for MRO dataframe columns

* Refined MRO app with SimpleMRO and MRO_Using_RL implementations

* Fixed perform_attacchment unittest error

* MRO Final PR Fix (#5)

* added testcases for updated cell_selection

* blacked and moved rxpower function

* Added mro_test notebook to test the mro app

* solve issue found

* Refactored the example notebook for MRO

* Debugging Tanzim's workflow

* added notebook sequence

* rxpwr bypass init

* f1, f0 done

* added all preprocess funcs

* minor fix

* got dict

* update

* update

* fixed dict data

* cleaned nb

* added docstrings

* minor fix

* completed training from scratch

* added the solve bug fix

* added todo and fixed rl

* update

* fixed col constraint issue & missing cell info issue

* fixed dtype mismatch

* added new update bdt logic

* added old mro in parallel to new

* fixed jitter issue

* minor type hint fixes

* added update() docstring

* formatted no rxpwr simpleMRO nb

* added _update()

* added save and load bdt

save and load tested in nb

added save and load; tested

* enabled cuda and flexibility for rl, fixed simple print for simple, removed redundent code for jitter

* reapplied covarience

* updated tests

* refactored predictions

* temp mro & mro pr-fix nb updated

* get rid of unused func and tests

* mro_pr-fix nb updated for sanity check

* addded cartesian check and nb

* addded cartesian nb heading updated

* moved norm_cells cartesian_check add_cell_info to radp_lib

* mro nb skeleton updated

* final mro nb with mro_data.zip, gitignore nb/req.txt updated

* added tests for mro

* added radp library tests

* removed debugging nbs

* tests done, rebased & epochs reset

* added mro readme at root

---------






* MRO PR-fix Changes (#6)

* added testcases for updated cell_selection

* blacked and moved rxpower function

* Added mro_test notebook to test the mro app

* solve issue found

* Refactored the example notebook for MRO

* Debugging Tanzim's workflow

* added notebook sequence

* rxpwr bypass init

* f1, f0 done

* added all preprocess funcs

* minor fix

* got dict

* update

* update

* fixed dict data

* cleaned nb

* added docstrings

* minor fix

* completed training from scratch

* added the solve bug fix

* added todo and fixed rl

* update

* fixed col constraint issue & missing cell info issue

* fixed dtype mismatch

* added new update bdt logic

* added old mro in parallel to new

* fixed jitter issue

* minor type hint fixes

* added update() docstring

* formatted no rxpwr simpleMRO nb

* added _update()

* added save and load bdt

save and load tested in nb

added save and load; tested

* enabled cuda and flexibility for rl, fixed simple print for simple, removed redundent code for jitter

* reapplied covarience

* updated tests

* refactored predictions

* temp mro & mro pr-fix nb updated

* get rid of unused func and tests

* mro_pr-fix nb updated for sanity check

* addded cartesian check and nb

* addded cartesian nb heading updated

* moved norm_cells cartesian_check add_cell_info to radp_lib

* mro nb skeleton updated

* final mro nb with mro_data.zip, gitignore nb/req.txt updated

* added tests for mro

* added radp library tests

* removed debugging nbs

* tests done, rebased & epochs reset

* added mro readme at root

* update mr nb removing no rxpwr flow

* added plots

* Added typecasting and docstrings to radp_library.py

* final sanity checked for cosmetics changes

* fixed simple & rl mro constructor

* fixed mro typehints

* safe delete mro nb & zip

* re added mro nb & zip

* added plotly req

* fixed dict to Dict type

---------






---------

Co-authored-by: Menon Pranto <[email protected]>
Co-authored-by: Ahnaf Tanjid <[email protected]>
Co-authored-by: RafidUl-Karim <[email protected]>
Co-authored-by: Ahnaf19 <ahnaftanjid19@@google.com>

* Completed load balance demo nb

* completed demo

* updated ue visuals

* convex hull visuals implemented

---------

Co-authored-by: tanzim10 <[email protected]>
Co-authored-by: Tanzim Farhan <[email protected]>
Co-authored-by: Ahnaf Tanjid <[email protected]>
Co-authored-by: RafidUl-Karim <[email protected]>
Co-authored-by: Ahnaf19 <ahnaftanjid19@@google.com>

* updated timesteps

* renamed load_balancing_app >> load_balancing

* renamed load_balance >> load_balancing

* minor fix

fixed a naming convention in notebook

* reward updated with cco score

* added logs data agents

---------

Co-authored-by: Lkishor123 <[email protected]>
Co-authored-by: WaterMenon09 <[email protected]>
Co-authored-by: Ahnaf Tanjid <[email protected]>
Co-authored-by: RafidUl-Karim <[email protected]>
Co-authored-by: Ahnaf19 <ahnaftanjid19@@google.com>
Co-authored-by: WaterMenon <[email protected]>

---------

Signed-off-by: Ahnaf19 <[email protected]>
Signed-off-by: WaterMenon <[email protected]>
Co-authored-by: WaterMenon09 <[email protected]>
Co-authored-by: Lkishor123 <[email protected]>
Co-authored-by: Menon Pranto <[email protected]>
Co-authored-by: Ahnaf Tanjid <[email protected]>
Co-authored-by: RafidUl-Karim <[email protected]>
Co-authored-by: Ahnaf19 <ahnaftanjid19@@google.com>
Co-authored-by: L Kishor <[email protected]>
@WaterMenon09 WaterMenon09 changed the title V1.0.2: MRO System Performance Improvements V1.0.3: MRO System Performance Improvements Sep 12, 2025
@WaterMenon09
Copy link
Contributor Author

could you please just run the end-to-end-test again for it to pass?

@WaterMenon09
Copy link
Contributor Author

Please make sure to reverse last Shah uncle's commit before merging

@WaterMenon09 WaterMenon09 changed the title V1.0.3: MRO System Performance Improvements Enhanced Mobility Robustness Optimization (MRO) Module Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants