File tree Expand file tree Collapse file tree
mapper/FFM/_make_pmappings/make_pmappings_from_templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import os
99import sys
1010
11- USER_CUSTOM_CONFIG_PATH_VAR = "ACCELFORGE_CONFIG_PATH"
12-
13-
14- def get_config () -> "Config" :
15- if USER_CUSTOM_CONFIG_PATH_VAR in os .environ :
16- f = os .environ [USER_CUSTOM_CONFIG_PATH_VAR ]
17- elif hasattr (sys , "real_prefix" ) or (
18- hasattr (sys , "base_prefix" ) and sys .base_prefix != sys .prefix
19- ):
20- f = os .path .join (sys .prefix , "accelforge" , "config.yaml" )
21- else :
22- f = os .path .join (user_config_dir ("accelforge" ), "config.yaml" )
23-
24- if not os .path .exists (f ):
25- logging .warning (f"No configuration file found. Creating config file at { f } ." )
26- os .makedirs (os .path .dirname (f ), exist_ok = True )
27- config = Config ()
28- config .to_yaml (f )
29-
30- logging .warning (f"Loading configuration file from { f } " )
31- return Config .from_yaml (f )
32-
3311
3412class Config (EvalableModel ):
3513 expression_custom_functions : EvalableList [str | Callable ] = EvalableList ()
Original file line number Diff line number Diff line change 77
88from accelforge .frontend .workload import Workload
99from accelforge .frontend .variables import Variables
10- from accelforge .frontend .config import Config , get_config
10+ from accelforge .frontend .config import Config
1111from accelforge .frontend .mapping import Mapping
1212from accelforge .frontend .model import Model
1313import hwcomponents
@@ -37,7 +37,7 @@ class Spec(EvalableModel):
3737 variables : Variables = Variables ()
3838 """ Variables that can be referenced in other places in the spec. """
3939
40- config : Config = Field ( default_factory = get_config )
40+ config : Config = Config ( )
4141 """ Configuration settings. """
4242
4343 renames : Renames = Renames ()
Original file line number Diff line number Diff line change @@ -155,7 +155,10 @@ def run_model(
155155
156156 per_memory_usage_df = {}
157157 for memory , occupancies in total_occupancy .items ():
158- if job .ignored_resources is not None and memory not in job .ignored_resources :
158+ ignored = (
159+ job .ignored_resources is not None and memory not in job .ignored_resources
160+ )
161+ if not ignored or metrics & Metrics .ACTIONS :
159162 key = f"usage<SEP>memory<SEP>{ memory } "
160163 per_memory_usage_df [key ] = (
161164 sum (occupancies .values ()) / memory_to_size [memory ]
You can’t perform that action at this time.
0 commit comments