Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Drop support for timemory python line-profiler
Browse files Browse the repository at this point in the history
- difficult to maintain
  • Loading branch information
jrmadsen committed Oct 11, 2023
1 parent 803b9ed commit 1f5f729
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 113 deletions.
3 changes: 0 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ environment:
BUILD_TESTING: "ON"
BUILD_EXAMPLES: "OFF"
RUN_EXAMPLES: "OFF"
LINE_PROFILER: "ON"
- PYTHON: 37
CPP: 14
CONFIG: Debug
Expand All @@ -58,7 +57,6 @@ environment:
BUILD_SHARED: "OFF"
BUILD_STATIC: "ON"
BUILD_TESTING: "OFF"
LINE_PROFILER: "OFF"
BUILD_EXAMPLES: "ON"
RUN_EXAMPLES: "OFF"

Expand Down Expand Up @@ -129,7 +127,6 @@ build_script:
-DTIMEMORY_BUILD_TOOLS="%TOOLS%"
-DTIMEMORY_BUILD_GOOGLE_TEST="%BUILD_TESTING%"
-DTIMEMORY_USE_WINSOCK="%WINSOCK%"
-DTIMEMORY_BUILD_PYTHON_LINE_PROFILER="%LINE_PROFILER%"
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- cmake --build . --config "%CONFIG%" --target ALL_BUILD -- /m /v:m /logger:%MSBuildLogger%
- cmake --build . --config "%CONFIG%" --target INSTALL -- /m /v:m /logger:%MSBuildLogger%
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ jobs:
--cxx-standard=17
--compile-time-perf ${HOME}/ctp
-- -V --output-on-failure
-- -DTIMEMORY_BUILD_{CALIPER,COMPILER_INSTRUMENTATION}=OFF -DPYTHON_EXECUTABLE=$(which python) -DTIMEMORY_BUILD_PYTHON_{HATCHET,LINE_PROFILER}=OFF -DCMAKE_INSTALL_PREFIX=${HOME}/timemory-install
-- -DTIMEMORY_BUILD_{CALIPER,COMPILER_INSTRUMENTATION}=OFF -DPYTHON_EXECUTABLE=$(which python) -DTIMEMORY_BUILD_PYTHON_HATCHET=OFF -DCMAKE_INSTALL_PREFIX=${HOME}/timemory-install
- run:
name: install
command: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
- BUILD_TYPE: 'Release'
BUILD_ARGS: '--build-libs shared --tools avail timem --cxx-standard=17'
CTEST_ARGS: '-V --output-on-failure'
CONFIG_ARGS: '-DTIMEMORY_BUILD_{CALIPER,COMPILER_INSTRUMENTATION}=OFF -DTIMEMORY_BUILD_PYTHON_{HATCHET,LINE_PROFILER}=OFF'
CONFIG_ARGS: '-DTIMEMORY_BUILD_{CALIPER,COMPILER_INSTRUMENTATION}=OFF -DTIMEMORY_BUILD_PYTHON_HATCHET=OFF'
PYTHON_VERSION: '3.8'
steps:
- name: Setup Environment
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ storage from the equation and, in doing so, transforms timemory into a toolkit f
- `timemory-python-trace`
- Python line-by-line profiler supporting all timemory components
- `from timemory.trace import Trace`
- `timemory-python-line-profiler`
- Python line-by-line profiler based on [line-profiler](https://pypi.org/project/line-profiler/) package
- Extended to use components: cpu-clock, memory-usage, context-switches, etc. (all components which collect scalar values)
- `from timemory.line_profiler import LineProfiler`
- Instrumentation Libraries
- [timemory-mpip](source/tools/timemory-mpip/README.md): MPI Profiling Library (Linux-only)
- [timemory-ncclp](source/tools/timemory-ncclp/README.md): NCCL Profiling Library (Linux-only)
Expand Down Expand Up @@ -243,7 +239,7 @@ main(int argc, char** argv)

// initialize with cmd-line
timemory_init(argc, argv);

// add argparse support
timemory_argparse(&argc, &argv);

Expand All @@ -260,7 +256,7 @@ main(int argc, char** argv)

// Add peak_rss component to specific_t
mpl::push_back_t<specific_t, comp::peak_rss> wprss{ "with peak_rss" };

// create region collecting only peak_rss
component_tuple<comp::peak_rss> oprss{ "only peak_rss" };

Expand All @@ -279,7 +275,7 @@ main(int argc, char** argv)
runtime::configure<comp::user_global_bundle>({ TIMEMORY_WALL_CLOCK, TIMEMORY_CPU_CLOCK });
// configure the generic bundle via component instances
comp::user_global_bundle::configure<comp::page_rss, comp::papi_vector>();

generic_t g{ "generic", quirk::config<quirk::auto_start>{} };
g.stop();

Expand Down
2 changes: 0 additions & 2 deletions cmake/Modules/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,6 @@ timemory_add_option(
"Disable arch flags which may cause portability issues (e.g. AVX-512)" OFF)
timemory_add_option(TIMEMORY_BUILD_PYTHON "Build Python bindings with internal pybind11"
ON)
timemory_add_option(TIMEMORY_BUILD_PYTHON_LINE_PROFILER
"Build customized Python line-profiler" ON)
timemory_add_option(TIMEMORY_BUILD_PYTHON_HATCHET "Build internal Hatchet distribution"
ON)
timemory_add_option(TIMEMORY_BUILD_LTO "Enable link-time optimizations in build" OFF)
Expand Down
1 change: 0 additions & 1 deletion docs/api/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ PACKAGE CONTENTS
ert (package)
hardware_counters (package)
libs (package)
line_profiler (package)
mpi (package)
mpi_support (package)
notebook (package)
Expand Down
1 change: 0 additions & 1 deletion examples/ex-python/ex_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

"""Example
@PYTHON_EXECUTABLE@ -m timemory.profiler -b -m 10 -- ./@FILENAME@
@PYTHON_EXECUTABLE@ -m timemory.line_profiler -b -v -- ./@FILENAME@
@PYTHON_EXECUTABLE@ -m timemory.trace -b -- ./@FILENAME@
"""

Expand Down
1 change: 0 additions & 1 deletion examples/ex-python/ex_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

"""Example
@PYTHON_EXECUTABLE@ -m timemory.profiler -m 10 -- ./@FILENAME@
@PYTHON_EXECUTABLE@ -m timemory.line_profiler -v -- ./@FILENAME@
@PYTHON_EXECUTABLE@ -m timemory.trace -- ./@FILENAME@
"""

Expand Down
27 changes: 4 additions & 23 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
if(TIMEMORY_USE_PYTHON AND TIMEMORY_BUILD_PYTHON_LINE_PROFILER)
timemory_checkout_git_submodule(
RECURSIVE
RELATIVE_PATH external/line-profiler
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/jrmadsen/line_profiler.git
REPO_BRANCH timemory)

timemory_message(STATUS "Adding external/line-profiler...")
add_subdirectory(line-profiler)

if(TARGET libpytimemory AND TARGET _line_profiler)
add_dependencies(libpytimemory _line_profiler)
endif()
endif()
#
#
#

if(TIMEMORY_USE_PYTHON AND TIMEMORY_BUILD_PYTHON_HATCHET)
timemory_checkout_git_submodule(
Expand All @@ -22,8 +10,7 @@ if(TIMEMORY_USE_PYTHON AND TIMEMORY_BUILD_PYTHON_HATCHET)
REPO_URL https://github.com/jrmadsen/hatchet.git
REPO_BRANCH timemory)

# line_profiler might have already found Cython
if(CYTHON_EXECUTABLE)
if(NOT CYTHON_EXECUTABLE)
find_package(Cython QUIET)
endif()

Expand Down Expand Up @@ -86,12 +73,6 @@ if(TIMEMORY_USE_PYTHON AND TIMEMORY_BUILD_PYTHON_HATCHET)
endif()
endif()

if(NOT TARGET _line_profiler)
set(TIMEMORY_BUILD_PYTHON_LINE_PROFILER
OFF
PARENT_SCOPE)
endif()

if(NOT TARGET hatchet)
set(TIMEMORY_BUILD_PYTHON_HATCHET
OFF
Expand Down
45 changes: 0 additions & 45 deletions pyctest-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,51 +1151,6 @@ def add_timem_test(name, cmd):
},
)

pyct.test(
"timemory-python-line-profiler",
[
sys.executable,
"-m",
"timemory.line_profiler",
"-v",
"-l",
"-c",
"peak_rss",
"--",
"./ex_python_external",
"12",
],
{
"WORKING_DIRECTORY": pyct.BINARY_DIRECTORY,
"LABELS": pyct.PROJECT_NAME,
"TIMEOUT": "120",
"ENVIRONMENT": base_env,
},
)

pyct.test(
"timemory-python-line-profiler-builtin",
[
sys.executable,
"-m",
"timemory.line_profiler",
"-v",
"-l",
"-b",
"-c",
"wall_clock",
"--",
"./ex_python_builtin",
"10",
],
{
"WORKING_DIRECTORY": pyct.BINARY_DIRECTORY,
"LABELS": pyct.PROJECT_NAME,
"TIMEOUT": "120",
"ENVIRONMENT": base_env,
},
)

pyct.test(
"timemory-python-sample",
[
Expand Down
7 changes: 0 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,6 @@ def _add_cmake_bool_option(_args):
add_arg_bool_option("ncclp-library", "TIMEMORY_BUILD_NCCLP_LIBRARY")
add_arg_bool_option("mallocp-library", "TIMEMORY_BUILD_MALLOCP_LIBRARY")
add_arg_bool_option("python-hatchet", "TIMEMORY_BUILD_PYTHON_HATCHET")
add_arg_bool_option(
"python-line-profiler",
"TIMEMORY_BUILD_PYTHON_LINE_PROFILER",
doc="Build line_profiler with timemory backend",
)
# miscellaneous
add_arg_bool_option("pybind-install", "PYBIND11_INSTALL", default=False)
add_arg_bool_option("build-testing", "TIMEMORY_BUILD_TESTING")
Expand Down Expand Up @@ -406,7 +401,6 @@ def _generate_dist_info():
"timemory-plotter=timemory.plotting.__main__:try_plot",
"timemory-roofline=timemory.roofline.__main__:try_plot",
"timemory-analyze=timemory.analyze.__main__:try_analyze",
"timemory-python-line-profiler=timemory.line_profiler.__main__:main",
"timemory-python-profiler=timemory.profiler.__main__:main",
"timemory-python-trace=timemory.trace.__main__:main",
],
Expand Down Expand Up @@ -520,7 +514,6 @@ def _filter_manifest(_manifest, *args):
"timemory-plotter=timemory.plotting.__main__:try_plot",
"timemory-roofline=timemory.roofline.__main__:try_plot",
"timemory-analyze=timemory.analyze.__main__:try_analyze",
"timemory-python-line-profiler=timemory.line_profiler.__main__:main",
"timemory-python-profiler=timemory.profiler.__main__:main",
"timemory-python-trace=timemory.trace.__main__:main",
],
Expand Down
1 change: 0 additions & 1 deletion source/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ PACKAGE CONTENTS
ert (package)
hardware_counters (package)
libs (package)
line_profiler (package)
mpi (package)
mpi_support (package)
notebook (package)
Expand Down
5 changes: 0 additions & 5 deletions timemory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,4 @@ timemory_python_console_script("timemory-analyze" "timemory.analyze" "try_analyz
if(TIMEMORY_USE_PYTHON)
timemory_python_console_script("timemory-python-profiler" "timemory.profiler" "main")
timemory_python_console_script("timemory-python-trace" "timemory.trace" "main")

if(TIMEMORY_BUILD_PYTHON_LINE_PROFILER)
timemory_python_console_script("timemory-python-line-profiler"
"timemory.line_profiler" "main")
endif()
endif()
15 changes: 0 additions & 15 deletions timemory/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -346,21 +346,6 @@ build_info = sys.modules[__name__].__getattribute__("build_info")
version = sys.modules[__name__].__getattribute__("version")
"""Version string"""

# this is required for correct pickling
try:
if "line_profiler" not in sys.modules:
from . import line_profiler as lineprof

_lineprof = lineprof._line_profiler

sys.modules["line_profiler"] = lineprof
sys.modules["line_profiler._line_profiler"] = _lineprof
except (ImportError, AttributeError) as e:
if os.path.exists(os.path.join(os.path.dirname(__file__), "line_profiler")):
import warnings

warnings.warn(f"{e}")

# try to import the local hatchet first
try:
from . import hatchet as local_hatchet
Expand Down

0 comments on commit 1f5f729

Please sign in to comment.