Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
0e1303a
reindex vs merge
jpn-- Jun 24, 2021
99d6f70
start work on benchmarking
jpn-- Jul 1, 2021
1ea2c39
as a suite
jpn-- Jul 1, 2021
a96c087
timing and setup
jpn-- Jul 1, 2021
555967a
streamlining
jpn-- Jul 1, 2021
daaff62
feat: add optional sha256 to example manifest
jpn-- Jul 1, 2021
0adc2a2
download files in setup_cache
jpn-- Jul 1, 2021
0577363
finish suite
jpn-- Jul 1, 2021
341521f
ex press
jpn-- Jul 1, 2021
2e78e8e
Merge branch 'chunkless' into performance1
jpn-- Jul 2, 2021
13a9eed
component logging
jpn-- Jul 2, 2021
522d517
more stable logging
jpn-- Jul 2, 2021
1d8ec5d
no locutor for school location in benchmarking
jpn-- Jul 2, 2021
0a3db94
read-only pipeline
jpn-- Jul 2, 2021
8d75fc2
don't write to checkpoints when reading them
jpn-- Jul 2, 2021
62e97ac
don't rollover for every timing
jpn-- Jul 2, 2021
0d497e9
log exceptions in benchmarks
jpn-- Jul 2, 2021
ca11aeb
table cleaning for mand tours freq
jpn-- Jul 2, 2021
f1b2d32
clean sweep all tables
jpn-- Jul 2, 2021
093c663
benchmark cli command
jpn-- Jul 2, 2021
5aa7110
benchmark test
jpn-- Jul 3, 2021
98a0642
better cli wrapper for asv
jpn-- Jul 4, 2021
fad1572
locally manage json
jpn-- Jul 4, 2021
1ba82e6
better workspace
jpn-- Jul 4, 2021
1c19902
benchmarks are in the package
jpn-- Jul 4, 2021
48f4340
local dir
jpn-- Jul 4, 2021
52dd0e7
ASIM_ASV_WORKSPACE
jpn-- Jul 4, 2021
a060c71
fix dir for download
jpn-- Jul 4, 2021
fa4600d
fix models dir
jpn-- Jul 4, 2021
79f6723
single thread flags
jpn-- Jul 4, 2021
1754103
allow asv to be missing
jpn-- Jul 5, 2021
b8ce055
fix args
jpn-- Jul 5, 2021
881b56c
change suite to module
jpn-- Jul 5, 2021
2c5fe27
no self
jpn-- Jul 5, 2021
c55e14a
partial
jpn-- Jul 5, 2021
2b3e2e6
discoverable
jpn-- Jul 5, 2021
23c7496
remote intermediate funcs
jpn-- Jul 5, 2021
e1a423c
call the partial
jpn-- Jul 5, 2021
f05e1cf
more parts
jpn-- Jul 5, 2021
1bd9a05
reraise
jpn-- Jul 5, 2021
685c2a8
refactor
jpn-- Jul 6, 2021
2644296
names
jpn-- Jul 6, 2021
9788123
to tour mode
jpn-- Jul 6, 2021
59f562a
tinker names
jpn-- Jul 6, 2021
f1bb837
just pretty
jpn-- Jul 6, 2021
b0c7dba
generic cleaning
jpn-- Jul 8, 2021
f9ca9c2
Merge branch 'condaforge-dev' into performance1
jpn-- Jul 17, 2021
5df7b42
define mtc1 as 20K households
jpn-- Jul 17, 2021
43723e1
ready for win
jpn-- Jul 17, 2021
c91f17c
pb branches
jpn-- Jul 18, 2021
50c24ba
Merge branch 'faster-maz-maz' into performance2
jpn-- Jul 18, 2021
d059d3b
Merge branch 'speeding-up-chunking' of https://github.com/ActivitySim…
jpn-- Jul 18, 2021
20ec9f1
more aggressive chunkless
jpn-- Jul 19, 2021
e4e5657
asv commit logging
jpn-- Jul 19, 2021
27bab07
Merge branch 'master' into performance2
jpn-- Sep 7, 2021
d90de76
Merge branch 'checksum-downloads' into performance2
jpn-- Sep 7, 2021
675f588
asv sandag1
jpn-- Sep 8, 2021
761319f
setup_cache as func
jpn-- Sep 8, 2021
1a7ba61
fix sandag1 benchmarks
jpn-- Sep 8, 2021
4e7d041
allow other configs dirs in prerun
jpn-- Sep 8, 2021
4bacdce
data and output definable
jpn-- Sep 8, 2021
e677f09
checksums were correct
jpn-- Sep 8, 2021
4e19b84
dirs in component setup
jpn-- Sep 8, 2021
e7eaaed
only use 20K hh for sandag tests
jpn-- Sep 8, 2021
6484ebd
documentation updates
jpn-- Sep 8, 2021
1c13c61
sandag2
jpn-- Sep 8, 2021
91cc417
submitting benchmarks
jpn-- Sep 8, 2021
ff0345c
fix sandag2 benchmarks
jpn-- Sep 8, 2021
dae575b
note about escapes
jpn-- Sep 8, 2021
b7fa769
pycodestyle
jpn-- Sep 8, 2021
579917e
sandag3
jpn-- Sep 9, 2021
1db6e1c
extra cli run args
jpn-- Sep 13, 2021
cbe00f8
extra logging
jpn-- Sep 13, 2021
6c52cd4
performanceTest
jpn-- Sep 13, 2021
db11669
elapsed time logging
jpn-- Sep 13, 2021
064942e
elapsed time logging
jpn-- Sep 13, 2021
52887e6
use cached accessibility
jpn-- Sep 13, 2021
b7beffa
settings remap
jpn-- Sep 14, 2021
93db698
Merge commit '6ba7e8ff386c95e3bf1b05864cc42461f1e953aa' into performa…
jpn-- Sep 14, 2021
47ed335
print line
jpn-- Sep 14, 2021
4359db0
profiling
jpn-- Sep 15, 2021
4708658
fix branch names
jpn-- Sep 15, 2021
d289734
use smaller sandag 2-zone
jpn-- Sep 15, 2021
37498ed
mp complete
jpn-- Sep 17, 2021
3d6a5b5
profile inspector
jpn-- Sep 17, 2021
f058751
sandag2 mp complete
jpn-- Sep 17, 2021
9f91840
Merge commit 'fd077d644fdb41200031f2860cfc0d60e2b90574' into performa…
jpn-- Sep 17, 2021
3b297aa
pipeline hash for benchmarking
jpn-- Sep 17, 2021
3a1331c
absolute import
jpn-- Sep 17, 2021
b515c02
manifest points to a place
jpn-- Sep 17, 2021
c687cc0
allow remote manifest files to be gzipped, then expanded after download.
jpn-- Sep 17, 2021
4e63ded
harmonize sandag3
jpn-- Sep 17, 2021
c6b336a
sandag1
jpn-- Sep 18, 2021
878e100
commit token
jpn-- Sep 19, 2021
55b9980
extra logging, stable option for prerun
jpn-- Sep 20, 2021
9cb9860
remove pipeline hash
jpn-- Sep 20, 2021
e41084d
sandag1e
jpn-- Sep 20, 2021
eb08c05
mostly templated sandag
jpn-- Sep 20, 2021
fe66db5
cleanup
jpn-- Sep 20, 2021
f9ec119
sandag3f
jpn-- Sep 20, 2021
67a18d5
use full population in data for MP complete test
jpn-- Sep 20, 2021
cf722a8
benchmark latest
jpn-- Sep 20, 2021
4949d90
benchmarking configs
jpn-- Sep 20, 2021
f352207
allow missing models
jpn-- Sep 20, 2021
0590bbc
sandag2f
jpn-- Sep 20, 2021
d937ecc
batch
jpn-- Sep 21, 2021
04129e0
update mp_complete name
jpn-- Sep 22, 2021
3637823
rename to fuller names
jpn-- Sep 23, 2021
4efd4ab
skip a few
jpn-- Sep 23, 2021
350aeb4
farm out setup cache
jpn-- Sep 24, 2021
403ec3b
template in componentwise
jpn-- Sep 24, 2021
5a536ae
normal logger
jpn-- Sep 24, 2021
932ee91
cwd error
jpn-- Sep 24, 2021
2169c7a
fix dirs
jpn-- Sep 24, 2021
a00741c
template mp complete
jpn-- Sep 24, 2021
7216304
template complete does not work
jpn-- Sep 24, 2021
bd41fc8
one ping only
jpn-- Sep 24, 2021
720d03e
fix sandag 2e
jpn-- Sep 24, 2021
2dfd76a
blacken
jpn-- Sep 24, 2021
9f1e0e4
cwise template blackened
jpn-- Sep 24, 2021
9d92158
remove cwise template
jpn-- Sep 24, 2021
7c55807
fix mtc1full benchmark
jpn-- Sep 27, 2021
8dc1924
clean old benchmark files
jpn-- Sep 27, 2021
b0e3447
hook to fix paths in benchmark output
jpn-- Sep 27, 2021
241ddb6
some docs
jpn-- Sep 27, 2021
0384d2c
documentation
jpn-- Sep 28, 2021
e936ec6
writing new benchmarks doc
jpn-- Sep 28, 2021
dac52e6
explicit benchmark versioning
jpn-- Sep 28, 2021
9be2832
use std name
jpn-- Sep 28, 2021
cbc6575
consistent single-thread benchmark size
jpn-- Sep 28, 2021
d4fe36a
tracking for mp benchmarks
jpn-- Sep 28, 2021
d419e06
fix log file path
jpn-- Sep 28, 2021
418c479
fix track read
jpn-- Sep 28, 2021
3b4b80f
clean up
jpn-- Sep 28, 2021
18128f2
minimally functional multithread benchmark
jpn-- Sep 29, 2021
7c3053d
todo note for MP bench
jpn-- Sep 29, 2021
6d63e7a
note about MP benchmarks
jpn-- Sep 29, 2021
bf64828
pycodestyle
jpn-- Sep 29, 2021
5ec18ed
remove config editing
jpn-- Sep 29, 2021
8bddc97
strip ruamel, not needed
jpn-- Sep 29, 2021
a01fcd1
fix to use dynamic configs dir
jpn-- Sep 29, 2021
b0e8495
Merge branch 'develop' of https://github.com/ActivitySim/activitysim …
jpn-- Nov 8, 2021
d1e73b6
use different branch
jpn-- Nov 8, 2021
7ce54aa
Merge commit 'd3ee01edaf17b093c14e559f45a029eb47c2ee5d' into performa…
jpn-- Nov 19, 2021
e3e4e33
benchmarking docs
jpn-- Nov 19, 2021
91f3f3c
point to final asim-benchmarks
jpn-- Nov 20, 2021
66210f9
Merge commit '3df695bd2bf921aa46d296a09889b68087b8c911' into performa…
jpn-- Nov 21, 2021
24c7db9
doc formatting cleanup
jpn-- Nov 22, 2021
dbee4cd
asv continuous
jpn-- Nov 22, 2021
5142bd7
include benchmarking in docs table of contents
jpn-- Nov 30, 2021
d6afb46
add doc for benchmark batch
jpn-- Jan 31, 2022
6efb433
dynamically get current branch for asv
jpn-- Jan 31, 2022
e65710c
some high level information on what Benchmarking does
jpn-- Jan 31, 2022
5683051
need to sync to publish
jpn-- Jan 31, 2022
2f580b8
branch arg
jpn-- Jan 31, 2022
d5eb981
add docs
jpn-- Feb 1, 2022
4a93836
Merge commit '74569ceae1f0f878de75ea328a0a0115abddeb97' into performa…
jpn-- Feb 1, 2022
fa6ecc6
constrain numpy
jpn-- Feb 1, 2022
8ef72ce
require xarray and sharrow for larch testing
jpn-- Mar 15, 2022
1a93cd3
add docstring for template_setup_cache
jpn-- Mar 31, 2022
b3d1d61
Merge branch 'develop' into performance1
jpn-- Apr 12, 2022
4779573
Update test_larch_estimation.py
jpn-- Apr 21, 2022
ec98fc3
pycodestyle
jpn-- Apr 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions activitysim/abm/models/accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def compute_accessibilities_for_zones(
trace_od_rows = None

# merge land_use_columns into od_df
logger.info(f"{trace_label}: merge land_use_columns into od_df")
od_df = pd.merge(od_df, land_use_df, left_on='dest', right_index=True).sort_index()
chunk.log_df(trace_label, "od_df", od_df)

Expand All @@ -69,11 +70,13 @@ def compute_accessibilities_for_zones(
if network_los.zone_system == los.THREE_ZONE:
locals_d['tvpb'] = network_los.tvpb

logger.info(f"{trace_label}: assign.assign_variables")
results, trace_results, trace_assigned_locals \
= assign.assign_variables(assignment_spec, od_df, locals_d,
trace_rows=trace_od_rows, trace_label=trace_label, chunk_log=True)

chunk.log_df(trace_label, "results", results)
logger.info(f"{trace_label}: have results")

# accessibility_df = accessibility_df.copy()
for column in results.columns:
Expand Down
12 changes: 6 additions & 6 deletions activitysim/abm/models/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ def preload_injectables():

t0 = tracing.print_elapsed_time()

# FIXME - still want to do this?
# if inject.get_injectable('skim_dict', None) is not None:
# t0 = tracing.print_elapsed_time("preload skim_dict", t0, debug=True)
#
# if inject.get_injectable('skim_stack', None) is not None:
# t0 = tracing.print_elapsed_time("preload skim_stack", t0, debug=True)
if config.setting('benchmarking', False):
# we don't want to pay for skim_dict inside any model component during
# benchmarking, so we'll preload skim_dict here. Preloading is not needed
# for regular operation, as activitysim components can load-on-demand.
if inject.get_injectable('skim_dict', None) is not None:
t0 = tracing.print_elapsed_time("preload skim_dict", t0, debug=True)

return True
8 changes: 8 additions & 0 deletions activitysim/abm/models/location_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,10 @@ def workplace_location(
# if multiprocessing.current_process().name =='mp_households_0':
# raise RuntimeError(f"fake fail {process_name}")

# disable locutor for benchmarking
if config.setting('benchmarking', False):
locutor = False

iterate_location_choice(
model_settings,
persons_merged, persons, households,
Expand Down Expand Up @@ -917,6 +921,10 @@ def school_location(
if estimator:
write_estimation_specs(estimator, model_settings, 'school_location.yaml')

# disable locutor for benchmarking
if config.setting('benchmarking', False):
locutor = False

iterate_location_choice(
model_settings,
persons_merged, persons, households,
Expand Down
1 change: 1 addition & 0 deletions activitysim/benchmarking/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import componentwise
171 changes: 171 additions & 0 deletions activitysim/benchmarking/asv.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
{
// The version of the config file format. Do not change, unless
// you know what you are doing.
"version": 1,

// The name of the project being benchmarked
"project": "activitysim",

// The project's homepage
"project_url": "https://activitysim.github.io/",

// The URL or local path of the source code repository for the
// project being benchmarked
"repo": ".",

// The Python project's subdirectory in your repo. If missing or
// the empty string, the project is assumed to be located at the root
// of the repository.
// "repo_subdir": "",

// Customizable commands for building, installing, and
// uninstalling the project. See asv.conf.json documentation.
//
// "install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"],
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
// "build_command": [
// "python setup.py build",
// "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}"
// ],

// List of branches to benchmark. If not provided, defaults to "master"
// (for git) or "default" (for mercurial).
// "branches": ["master"], // for git
// "branches": ["default"], // for mercurial

// The DVCS being used. If not set, it will be automatically
// determined from "repo" by looking at the protocol in the URL
// (if remote), or by looking for special directories, such as
// ".git" (if local).
// "dvcs": "git",

// The tool to use to create environments. May be "conda",
// "virtualenv" or other value depending on the plugins in use.
// If missing or the empty string, the tool will be automatically
// determined by looking for tools on the PATH environment
// variable.
"environment_type": "conda",

// timeout in seconds for installing any dependencies in environment
// defaults to 10 min
//"install_timeout": 600,

// the base URL to show a commit for the project.
"show_commit_url": "http://github.com/ActivitySim/activitysim/commit/",

// The Pythons you'd like to test against. If not provided, defaults
// to the current version of Python used to run `asv`.
// "pythons": ["2.7", "3.6"],

// The list of conda channel names to be searched for benchmark
// dependency packages in the specified order
"conda_channels": ["conda-forge"],

// The matrix of dependencies to test. Each key is the name of a
// package (in PyPI) and the values are version numbers. An empty
// list or empty string indicates to just test against the default
// (latest) version. null indicates that the package is to not be
// installed. If the package to be tested is only available from
// PyPi, and the 'environment_type' is conda, then you can preface
// the package name by 'pip+', and the package will be installed via
// pip (with all the conda available packages installed first,
// followed by the pip installed packages).
//
"matrix": {
"pyarrow": [],
"numpy": [],
"openmatrix": [],
"pandas": ["1.2"],
"pyyaml": [],
"pytables": [],
"toolz": [],
"orca": [],
"psutil": [],
"requests": [],
"numba": [],
"coverage": [],
"pytest": [],
"cytoolz": []
},

// Combinations of libraries/python versions can be excluded/included
// from the set to test. Each entry is a dictionary containing additional
// key-value pairs to include/exclude.
//
// An exclude entry excludes entries where all values match. The
// values are regexps that should match the whole string.
//
// An include entry adds an environment. Only the packages listed
// are installed. The 'python' key is required. The exclude rules
// do not apply to includes.
//
// In addition to package names, the following keys are available:
//
// - python
// Python version, as in the *pythons* variable above.
// - environment_type
// Environment type, as above.
// - sys_platform
// Platform, as in sys.platform. Possible values for the common
// cases: 'linux2', 'win32', 'cygwin', 'darwin'.
//
// "exclude": [
// {"python": "3.2", "sys_platform": "win32"}, // skip py3.2 on windows
// {"environment_type": "conda", "six": null}, // don't run without six on conda
// ],
//
// "include": [
// // additional env for python2.7
// {"python": "2.7", "numpy": "1.8"},
// // additional env if run on windows+conda
// {"platform": "win32", "environment_type": "conda", "python": "2.7", "libpython": ""},
// ],

// The directory (relative to the current directory) that benchmarks are
// stored in. If not provided, defaults to "benchmarks"
// "benchmark_dir": "benchmarks",

// The directory (relative to the current directory) to cache the Python
// environments in. If not provided, defaults to "env"
"env_dir": "../activitysim-asv/env",

// The directory (relative to the current directory) that raw benchmark
// results are stored in. If not provided, defaults to "results".
"results_dir": "../activitysim-asv/results",

// The directory (relative to the current directory) that the html tree
// should be written to. If not provided, defaults to "html".
"html_dir": "../activitysim-asv/html",

// The number of characters to retain in the commit hashes.
// "hash_length": 8,

// `asv` will cache results of the recent builds in each
// environment, making them faster to install next time. This is
// the number of builds to keep, per environment.
// "build_cache_size": 2,

// The commits after which the regression search in `asv publish`
// should start looking for regressions. Dictionary whose keys are
// regexps matching to benchmark names, and values corresponding to
// the commit (exclusive) after which to start looking for
// regressions. The default is to start from the first commit
// with results. If the commit is `null`, regression detection is
// skipped for the matching benchmark.
//
// "regressions_first_commits": {
// "some_benchmark": "352cdf", // Consider regressions only after this commit
// "another_benchmark": null, // Skip regression detection altogether
// },

// The thresholds for relative change in results, after which `asv
// publish` starts reporting regressions. Dictionary of the same
// form as in ``regressions_first_commits``, with values
// indicating the thresholds. If multiple entries match, the
// maximum is taken. If no entry matches, the default is 5%.
//
// "regressions_thresholds": {
// "some_benchmark": 0.01, // Threshold of 1%
// "another_benchmark": 0.5, // Threshold of 50%
// },
}
Empty file.
83 changes: 83 additions & 0 deletions activitysim/benchmarking/benchmarks/mtc1full.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from activitysim.benchmarking.componentwise import (
template_component_timings,
template_setup_cache,
)

EXAMPLE_NAME = "example_mtc_full"
CONFIGS_DIRS = ("configs",)
DYNAMIC_CONFIG_DIR = "bench_configs"
DATA_DIR = "data"
OUTPUT_DIR = "output"
COMPONENT_NAMES = [
# "compute_accessibility",
"school_location",
"workplace_location",
"auto_ownership_simulate",
"free_parking",
"cdap_simulate",
"mandatory_tour_frequency",
"mandatory_tour_scheduling",
"joint_tour_frequency",
"joint_tour_composition",
"joint_tour_participation",
"joint_tour_destination",
"joint_tour_scheduling",
"non_mandatory_tour_frequency",
"non_mandatory_tour_destination",
"non_mandatory_tour_scheduling",
"tour_mode_choice_simulate",
"atwork_subtour_frequency",
"atwork_subtour_destination",
"atwork_subtour_scheduling",
"atwork_subtour_mode_choice",
"stop_frequency",
"trip_purpose",
"trip_destination",
"trip_purpose_and_destination",
"trip_scheduling",
"trip_mode_choice",
# "write_data_dictionary",
# "track_skim_usage",
"write_trip_matrices",
# "write_tables",
]
BENCHMARK_SETTINGS = {
"households_sample_size": 48_769,
}
SKIM_CACHE = False
PRELOAD_INJECTABLES = ("skim_dict",)
REPEAT = 1
NUMBER = 1
TIMEOUT = 36000.0 # ten hours
VERSION = "1"


def setup_cache():
template_setup_cache(
EXAMPLE_NAME,
COMPONENT_NAMES,
BENCHMARK_SETTINGS,
dict(
read_skim_cache=SKIM_CACHE,
write_skim_cache=SKIM_CACHE,
),
CONFIGS_DIRS,
DATA_DIR,
OUTPUT_DIR,
config_overload_dir=DYNAMIC_CONFIG_DIR,
)


template_component_timings(
globals(),
COMPONENT_NAMES,
EXAMPLE_NAME,
(DYNAMIC_CONFIG_DIR, *CONFIGS_DIRS),
DATA_DIR,
OUTPUT_DIR,
PRELOAD_INJECTABLES,
REPEAT,
NUMBER,
TIMEOUT,
VERSION,
)
Loading