Skip to content
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
30 changes: 28 additions & 2 deletions ABOUT-LICENSING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ following license:
> OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

When compiling Ginkgo with `-DGINKGO_BUILD_BENCHMARKS=ON` the build system will
download, build, and link [gflags](https://github.com/gflags/gflags) and
[nlohmann-json](https://github.com/nlohmann/json) with the
download, build, and link [gflags](https://github.com/gflags/gflags),
[nlohmann-json](https://github.com/nlohmann/json), and
[json-schema-validator](https://github.com/pboettch/json-schema-validator) with the
benchmark suites. gtest is available under the following license:

> Copyright (c) 2006, Google Inc.
Expand Down Expand Up @@ -106,6 +107,31 @@ nlohmann-json is available under the following license:
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

json-schema-validator is available under the following license:

> Modern C++ JSON schema validator is licensed under the MIT License
> <http://opensource.org/licenses/MIT>:
>
> Copyright (c) 2016 Patrick Boettcher
>
> Permission is hereby granted, free of charge, to any person obtaining a copy of
> this software and associated documentation files (the "Software"), to deal in
> the Software without restriction, including without limitation the rights to
> use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
> of the Software, and to permit persons to whom the Software is furnished to do
> so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

For generating the documentation of Ginkgo, some scripts from the deal.II
library are used. You can refer to the `doc/` folder to see which files are a
modified version of deal.II's documentation generation scripts. Additionally,
Expand Down
8 changes: 7 additions & 1 deletion benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ function(
type
)
add_executable("${name}" ${ARGN})
target_link_libraries("${name}" ginkgo gflags nlohmann_json::nlohmann_json)
target_link_libraries(
"${name}"
ginkgo
gflags
nlohmann_json::nlohmann_json
nlohmann_json_schema_validator
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also need to add the license from nlohmann_json_schema_validator

)
# always include the device timer
if(GINKGO_BUILD_CUDA)
target_compile_definitions("${name}" PRIVATE HAS_CUDA_TIMER=1)
Expand Down
70 changes: 70 additions & 0 deletions benchmark/schema/blas-distributed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Distributed BLAS",
"description": "Input for a single BLAS operation with distributed vectors",
"type": "object",
"properties": {
"n": {
"type": "integer",
"minimum": 1
},
"r": {
"type": "integer",
"minimum": 1
},
"stride": {
"type": "integer",
"minimum": 1
},
"stride_x": {
"type": "integer",
"minimum": 1
},
"stride_y": {
"type": "integer",
"minimum": 1
}
},
"if": {
"required": [
"stride"
]
},
Comment on lines +28 to +32
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you share the documentation for this?
I interpret it like if required stride then ...
but it never require stride right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this can help: https://json-schema.org/understanding-json-schema/reference/conditionals#ifthenelse.
I think the if tries to check if anything specified here validates. So it checks if the required validates, and based on that chooses the then or else branch.

"then": {
"not": {
"anyOf": [
{
"required": [
"stride_x"
]
},
{
"required": [
"stride_y"
]
}
]
}
},
"required": [
"n"
],
"examples": [
{
"n": 1000
},
{
"n": 1000,
"r": 1000
},
{
"n": 1000,
"stride": 1024
},
{
"n": 1000,
"stride_x": 1024,
"stride_y": 2048
}
]
}
92 changes: 92 additions & 0 deletions benchmark/schema/blas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "BLAS",
"description": "Input for a single BLAS operation",
"type": "object",
"properties": {
"n": {
"type": "integer",
"minimum": 1
},
"r": {
"type": "integer",
"minimum": 1
},
"m": {
"type": "integer",
"minimum": 1
},
"k": {
"type": "integer",
"minimum": 1
},
"stride": {
"type": "integer",
"minimum": 1
},
"stride_x": {
"type": "integer",
"minimum": 1
},
"stride_y": {
"type": "integer",
"minimum": 1
},
"stride_A": {
"type": "integer",
"minimum": 1
},
"stride_B": {
"type": "integer",
"minimum": 1
},
"stride_C": {
"type": "integer",
"minimum": 1
}
},
"if": {
"required": [
"stride"
]
},
"then": {
"not": {
"anyOf": [
{
"required": [
"stride_x"
]
},
{
"required": [
"stride_y"
]
}
]
}
},
"required": [
"n"
],
"examples": [
{
"n": 1000
},
{
"n": 1000,
"r": 1000,
"m": 1000,
"k": 1000
},
{
"n": 1000,
"stride": 1024
},
{
"n": 1000,
"stride_x": 1024,
"stride_y": 2048
}
]
}
35 changes: 35 additions & 0 deletions benchmark/schema/conversion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Conversion",
"description": "Input for a single conversion operation",
"type": "object",
"properties": {
"operator": {
"$ref": "operator.reuse.json"
}
},
"required": [
"operator"
],
"not": {
"required": [
"format",
"reorder"
]
},
"examples": [
{
"operator": {
"filename": "my_file.mtx"
}
},
{
"operator": {
"stencil": {
"name": "5pt",
"size": 100
}
}
}
]
}
46 changes: 46 additions & 0 deletions benchmark/schema/matrix-generator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Matrix Generator",
"description": "Input for a single matrix generation operation",
"type": "object",
"properties": {
"filename": {
"type": "string"
},
"problem": {
"type": "object",
"properties": {
"type": {
"enum": [
"block-diagonal"
]
},
"num_blocks": {
"type": "integer",
Comment thread
yhmtsai marked this conversation as resolved.
"minimum": 1
},
"block_size": {
"type": "integer",
"minimum": 1
}
}
}
},
"required": [
"filename",
"problem"
],
"examples": [
{
"$comment": "The generated matrix will have a dense block of size <block-size>, with random real values chosen uniformly in the interval [-1, 1], repeated <num-blocks> times on the diagonal"
},
{
"filename": "output_matrix.mtx",
"problem": {
"type": "block-diagonal",
"num_blocks": 2,
"block_size": 2
}
}
]
}
29 changes: 29 additions & 0 deletions benchmark/schema/matrix-statistics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Matrix Statistics",
"description": "Input for a single matrix statistics operation",
"type": "object",
"properties": {
"operator": {
"$ref": "operator.reuse.json"
}
},
"required": [
"operator"
],
"examples": [
{
"operator": {
"filename": "my_file.mtx"
}
},
{
"operator": {
"stencil": {
"name": "5pt",
"size": 100
}
}
}
]
}
53 changes: 53 additions & 0 deletions benchmark/schema/operator-distributed.reuse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "operator-distributed.reuse.json",
"title": "Distributed Operator",
"description": "Reusable distributed operator definition",
"type": "object",
"properties": {
"filename": {
"type": "string"
},
"stencil": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will also lead the format changes. Is it intentional?
previously,

"stencil": "5pt",
"local_size" ....

now

"stencil": {
  "name": "5pt",
  ...
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, because I find this more consistent. But if others prefer the old version, I can revert.

"type": "object",
"properties": {
"kind": {
"enum": [
"5pt",
"7pt",
"9pt",
"27pt"
]
},
"local_size": {
"type": "integer",
"exclusiveMinimum": 0
},
"comm_pattern": {
"enum": [
"stencil",
"optimal"
],
"default": "stencil"
}
},
"required": [
"kind",
"local_size"
]
}
},
"additionalProperties": false,
"oneOf": [
{
"required": [
"filename"
]
},
{
"required": [
"stencil"
]
}
]
}
Loading
Loading