Skip to content

Add a new concurrent hashmap benchmark to AI benchmark suite in DCPerf. #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v2-beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions benchpress/config/benchmarks_ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ rebatch:
metrics:
- bandwidth
- time_per_batch_us

chm:
parser: chm
install_script: ./packages/chm/install_chm.sh
cleanup_script: ./packages/chm/cleanup_chm.sh
path: ./benchmarks/chm/chm_bench
metrics:
- Mops/sec
31 changes: 29 additions & 2 deletions benchpress/config/jobs_ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

- benchmark: rebatch
name: rebatch_a
description: rebatch benchmark for Model A.
description: Rebatch benchmark for Model A.
args:
- '--threads={threads}'
- '--duration={duration}'
Expand All @@ -125,7 +125,7 @@

- benchmark: rebatch
name: rebatch_b
description: rebatch benchmark for Model B.
description: Rebatch benchmark for Model B.
args:
- '--threads={threads}'
- '--duration={duration}'
Expand All @@ -143,3 +143,30 @@
- 'prefetch=0'
- 'output_tensor_size=2421002'
- 'memory_pool_size=4'

- benchmark: chm
name: chm_a
description: Concurrent hash map benchmark for Model A.
args:
- '--distribution_file={distribution_file}'
- '--num_threads={num_threads}'
- '--duration_seconds={duration_seconds}'

vars:
- 'distribution_file=benchmarks/chm/model_a.dist'
- 'num_threads=24'
- 'duration_seconds=360'


- benchmark: chm
name: chm_b
description: Concurrent hash map benchmark for Model B.
args:
- '--distribution_file={distribution_file}'
- '--num_threads={num_threads}'
- '--duration_seconds={duration_seconds}'

vars:
- 'distribution_file=benchmarks/chm/model_b.dist'
- 'num_threads=24'
- 'duration_seconds=360'
2 changes: 2 additions & 0 deletions benchpress/plugins/parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .benchdnn import BenchdnnParser
from .cachebench import CacheBenchParser
from .checkmark import CheckmarkParser
from .chm import ChmParser
from .clang import ClangParser
from .cloudsuite_graph import CloudSuiteGraphParser
from .compression_parser import CompressionParser
Expand Down Expand Up @@ -104,6 +105,7 @@ def register_parsers(factory):
factory.register("syscall", SyscallParser)
factory.register("embedding", EmbeddingParser)
factory.register("rebatch", RebatchParser)
factory.register("chm", ChmParser)

if not open_source:
factory.register("adsim", AdSimParser)
27 changes: 27 additions & 0 deletions benchpress/plugins/parsers/chm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-unsafe
import re

from benchpress.lib.parser import Parser


class ChmParser(Parser):
def parse(self, stdout, stderr, returncode):
metrics = {}

# Parse stdout for operations per second
for line in stdout:
# Match "Millions of Operations per Second: X Mops/sec"
match = re.search(
r"Millions of Operations per Second:\s*(\d+\.\d+)\s*Mops/sec", line
)
if match:
metrics["Mops/sec"] = float(match.group(1))
break

return metrics
17 changes: 17 additions & 0 deletions packages/chm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.10)
project(ChmBench LANGUAGES CXX)

set(CMAKE_PREFIX_PATH
"${CMAKE_SOURCE_DIR}/installed"
${CMAKE_PREFIX_PATH})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


find_package(folly CONFIG REQUIRED)
find_package(gflags CONFIG REQUIRED)

add_executable(chm_bench ChmBenchmark.cpp)


target_link_libraries(chm_bench PRIVATE Folly::folly)
Loading