Coder Social home page Coder Social logo

anupli / running-ng Goto Github PK

View Code? Open in Web Editor NEW
4.0 5.0 7.0 2.53 MB

Running next generation

Home Page: https://anupli.github.io/running-ng/

License: Apache License 2.0

Python 100.00%
methodology benchmarking benchmark-framework garbage-collection

running-ng's Introduction

running-ng

running-ng is a collection of scripts that help people run workloads in a methodologically sound settings.

Installation

pip3 install running-ng

There are two extras available.

  • zulip: dependencies for the Zulip runbms plugin, useful for users.
  • tests: dependencies for running tests, useful for package developers.

Development setup

virtualenv env
source env/bin/activate
pip install -e .[zulip,tests]
pip install -U pip setuptools build[virtualenv] twine # extra packages for building releases
  • To make a distribution archives, run python -m build within the virtual environment.
  • To install to user site-packages, run pip install dist/running_ng-<VERSION>-py3-none-any.whl outside the virtual environment.
  • To update to PyPI, run twine upload --repository running-ng dist/*<VERSION>*.

Documentation

Please refer to this site for up-to-date documentations.

License

This project is licensed under the Apache License, Version 2.0.

running-ng's People

Contributors

angussidney avatar caizixian avatar dependabot[bot] avatar k-sareen avatar qinsoon avatar shamouda avatar tianleq avatar wenyuzhao avatar wks avatar xinyu-zheng avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

running-ng's Issues

Support companion commands

Currently we support wrapper commands. It might make sense to also add companion commands that are launched before the main program, and are SIGINTed after the main program exits. This is useful, e.g., for running eBPF tracing.

Return code is 0 for ValueError

For example, with the following error, we should expect running to return a non-zero value. When we use running for CI, a zero return value is considered as pass, and can easily be neglected unless we look into the logs.

Run id: linux-x86_64-batik-fastdebug-fv-az477-706-2023-09-13-Wed-024258
Traceback (most recent call last):
  File "/home/runner/.local/bin/running", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.local/lib/python3.10/site-packages/running/__main__.py", line 48, in main
    if m.run(args):
  File "/home/runner/.local/lib/python3.10/site-packages/running/command/runbms.py", line 383, in run
    configuration.resolve_class()
  File "/home/runner/.local/lib/python3.10/site-packages/running/config.py", line [46](https://github.com/mmtk/mmtk-openjdk/actions/runs/6167075597/job/16738052124?pr=241#step:15:47), in resolve_class
    self.__items[cls_name] = load_class(
  File "/home/runner/.local/lib/python3.10/site-packages/running/config.py", line 14, in load_class
    return {k: cls.from_config(k, v) for (k, v) in config.items()}
  File "/home/runner/.local/lib/python3.10/site-packages/running/config.py", line 14, in <dictcomp>
    return {k: cls.from_config(k, v) for (k, v) in config.items()}
  File "/home/runner/.local/lib/python3.10/site-packages/running/suite.py", line [47](https://github.com/mmtk/mmtk-openjdk/actions/runs/6167075597/job/16738052124?pr=241#step:15:48), in from_config
    return BenchmarkSuite.CLS_MAPPING[config["type"]](name=name, **config)
  File "/home/runner/.local/lib/python3.10/site-packages/running/suite.py", line 109, in __init__
    raise ValueError(
ValueError: DaCapo release rc not recongized

Refactoring out DaCapo hacks into the DaCapo class

When running DaCapo with callbacks (by overriding the callback of an instance of DaCapo), it uses -cp instead of -jar to run DaCapo, which bypasses the MANIFEST file in the jar, causing issues like below

java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.dacapo.harness.Cassandra.prepare(Cassandra.java:124)
    at org.dacapo.harness.Benchmark.run(Benchmark.java:205)
    at org.dacapo.harness.TestHarness.runBenchmark(TestHarness.java:225)
    at org.dacapo.harness.TestHarness.main(TestHarness.java:170)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at Harness.main(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
    at org.apache.cassandra.config.DatabaseDescriptor.guessFileStore(DatabaseDescriptor.java:1193)
    at org.apache.cassandra.config.DatabaseDescriptor.applySimpleConfig(DatabaseDescriptor.java:550)
    at org.apache.cassandra.config.DatabaseDescriptor.applyAll(DatabaseDescriptor.java:350)
    at org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:178)
    at org.apache.cassandra.config.DatabaseDescriptor.daemonInitialization(DatabaseDescriptor.java:162)
    at org.apache.cassandra.service.CassandraDaemon.applyConfig(CassandraDaemon.java:816)
    at org.apache.cassandra.service.EmbeddedCassandraService.start(EmbeddedCassandraService.java:49)
    ... 13 more
Caused by: java.lang.RuntimeException: java.lang.IllegalAccessException: access to public member failed: jdk.internal.ref.Cleaner.clean[Ljava.lang.Object;@78fbff54/invokeVirtual, from org.apache.cassandra.io.util.FileUtils (unnamed module @158da8e)
    at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:107)
    ... 20 more
Caused by: java.lang.IllegalAccessException: access to public member failed: jdk.internal.ref.Cleaner.clean[Ljava.lang.Object;@78fbff54/invokeVirtual, from org.apache.cassandra.io.util.FileUtils (unnamed module @158da8e)
    at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:942)
    at java.base/java.lang.invoke.MethodHandles$Lookup.checkAccess(MethodHandles.java:2201)
    at java.base/java.lang.invoke.MethodHandles$Lookup.checkMethod(MethodHandles.java:2141)
    at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:2285)
    at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(MethodHandles.java:2278)
    at java.base/java.lang.invoke.MethodHandles$Lookup.unreflect(MethodHandles.java:1747)
    at org.apache.cassandra.io.util.FileUtils.<clinit>(FileUtils.java:96)

The current workaround changes JavaBenchmark instead of DaCapo, which can be confusing for people using other Java benchmark suites. This DaCapo specific hack should be moved to DaCapo

if isinstance(runtime, OpenJDK):

This DaCapo specific hack should be moved to DaCapo, and be conditional on whether -jar is used.

if self.callback:

Code comment and documentation need to be added.

Deprecate some builtin modifiers

Some of the flags, especially the initial set of OpenJDK related flags are purely artifacts of the limitation of early versions of the MMTk OpenJDK binding.

This is now becoming a headache as unsuspecting people using these default modifier can introduce methodological errors (such as triggering GC before the benchmark timing iteration or not).
Many of the numerical values are arbitrary and should either be removed or turned into modifiers with value arguments.

This is potentially a breaking change if people rely on the behaviors of these modifiers.

Add slice/mega mode

Sometimes we want to specify a particular hfac (e.g. 1500 or 1.5x, 9999 or 9.999x) to, say have a very large heap so that we will only perform nursery collection.
Previously, it's supported as -s and -m through the command lines.

Common modifiers for configs

For all the 'configs' in a run, usually there are some common modifiers that ensure each config is measured with the same methodology. For example, using the same probe, using the same command line arguments, etc. It would be good if we can set common modifiers for configs.

Disable OpenJDK GC weak references processing

MMTk GCs (with OpenJDK binding) do not support weak-ref processing at the moment. For a fair comparison when running benchmarks, we should find a way to (effectively) disable OpenJDK GC's weak reference processing and make them treat weak-refs as strong.

Support different timing iterations for different benchmarks

DaCapo supports the convergence mode that it keeps repeating benchmark iteration until the wall clock time of each iteration stabilise.
We might also want to support specifying the timing iteration for different benchmarks.

Note that both approach have the problem that it's hard to filter out the last iteration on plotty.

Support more flexible heap size modifiers

Proposed by @wks

modifiers:
  heap2x:
    type: HeapSize
    multiplier: 2
  heap64m:
    type: HeapSize
    size: "64M"
  heapdyn:
    type: HeapSize
    min: "1M"
    max: "128G"
configs:
  - "build1|mmtk_gc-Immix|heap2x"
  - "build1|mmtk_gc-Immix|heap64m"
  - "build1|mmtk_gc-Immix|heapdyn"

The special modifier type HeapSize overrides the heap size setting given on the command line (if any). If the multipler: key is given, the heap size will be computed from the min heap size provided by dacapo.yml. If size: is given, it is fixed heap size. If max: and min: are given, it will be dynamic heap size.

Filter out empty modifiers in configs

Right now, if you have a config like openjdk7||foobar, you will get a confusing error message KeyError: "Modifier '' not defined". We could filter out empty modifiers.

Get rid of `--add-opens` workaround, and turn it into a modifier shipped with running-ng

It's currently not sufficient.

  h2o21:
    type: JVMArg
    val: "-Dsys.ai.h2o.debug.allowJavaVersions=21 --add-opens java.base/java.lang=ALL-UNNAMED"
    includes:
      dacapochopin-rc5:
        - h2o
  cassandra21:
    type: JVMArg
    val: "-Djava.security.manager=allow --add-exports java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED"
    includes:
      dacapochopin-rc5:
        - cassandra
  trades21:
    type: JVMArg
    val: "--add-opens java.base/java.util=ALL-UNNAMED"
    includes:
      dacapochopin-rc5:
        - tradebeans
        - tradesoap

Write user manual

  • Basics
  • Conventions
  • Benchmark suites
  • Runtime
  • runbms
  • minheaps
  • fillin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.