Skip to content

Commit

Permalink
Merge pull request #1115 from apache/dev-postgresql
Browse files Browse the repository at this point in the history
Merge dev_postgresql into the master branch
  • Loading branch information
chrishkchris authored Oct 25, 2023
2 parents 61a810f + 17ac0ad commit e62ebfc
Show file tree
Hide file tree
Showing 208 changed files with 23,221 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ LIST(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Thirdparty)
#string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "${VERSION}")


SET(PACKAGE_VERSION 4.0.0) # ${VERSION})
SET(VERSION 4.0.0)
SET(PACKAGE_VERSION 4.1.0) # ${VERSION})
SET(VERSION 4.1.0)
SET(SINGA_MAJOR_VERSION 4)
SET(SINGA_MINOR_VERSION 0)
SET(SINGA_MINOR_VERSION 1)
SET(SINGA_PATCH_VERSION 0)
#SET(SINGA_MAJOR_VERSION ${VERSION_MAJOR}) # 0 -
#SET(SINGA_MINOR_VERSION ${VERSION_MINOR}) # 0 - 9
Expand Down
56 changes: 56 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -559,3 +559,59 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

===============================================================================
SINGA bundles the following under MIT License:
examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/pg_extension/*

MIT License

Portions Copyright 2019-2021 ZomboDB, LLC.
Portions Copyright 2021-2023 Technology Concepts & Design, Inc.
Portions Copyright 2023 PgCentral Foundation, Inc.

All rights reserved.

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.

===============================================================================
SINGA bundles the following under The PostgreSQL License:
examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/pg_extension/*

The PostgreSQL License

Portions Copyright (c) 1996-2023, The PostgreSQL Global Development Group

Portions Copyright (c) 1994, The Regents of the University of California

Permission to use, copy, modify, and distribute this software and its documentation for any
purpose, without fee, and without a written agreement is hereby granted, provided that the above
copyright notice and this paragraph and the following two paragraphs appear in all copies.

IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

13 changes: 13 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,16 @@ developers of Apache SINGA under Apache License, Version 2.0.
./doc/_static/images/sgd.png
./doc/_static/images/singa.png
./doc/_static/images/singav1-sw.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/documents/image-20231020174425377.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/documents/image-20231020174945226.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230421214835152.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230421220338391.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230421220443231.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230702035554579.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230702035622198.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230702035639502.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230702035806963.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230722202555763.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230722205244718.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230724111325368.png
./examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/documents/imgs/image-20230724111659545.png
37 changes: 37 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
Release Notes - SINGA - Version singa-4.1.0

SINGA is a distributed deep learning library.

This release includes following changes:

* New examples
* Add an example for malaria detection using cell images.
* Add an example for structured data learning.

* Add support for models running on top of RDBMS
* Add support for in-database model definition and selection in RDBMS.
* Implement training-free model evaluation metrics for in-database model selection.
* Implement a coordinator to balance between training-free and training-based model evaluations
for in-database model selection.

* Enhance distributed training
* Add implementations for the sum error loss.
* Improve the optimizer to return model gradients.
* Improve the iterative checking for tensors and strings in the ModelMeta class.

* Enhance example code
* Add support for flexible setting of training configurations for models, e.g., learning rates,
weight decay, momentum, etc.
* Add implementations for dynamic models with varying layer sizes.

* Update the website
* Add illustrations for database integration.
* Update users of Apache SINGA.

* Fix bugs
* Update the NVIDIA_GPGKEY in the Dockerfile for building wheel files.
* Update the versions of dependencies in the wheel file.
* Fix the collections module in the model.py file.

----------------------------------------------------------------------------------------------

Release Notes - SINGA - Version singa-4.0.0

SINGA is a distributed deep learning library.
Expand Down
63 changes: 63 additions & 0 deletions doap/doap_SINGA.rdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"?>
<rdf:RDF xml:lang="en"
xmlns="http://usefulinc.com/ns/doap#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:asfext="http://projects.apache.org/ns/asfext#"
xmlns:foaf="http://xmlns.com/foaf/0.1/">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Project rdf:about="https://singa.apache.org/">
<created>2023-09-06</created>
<license rdf:resource="https://spdx.org/licenses/Apache-2.0" />
<name>Apache SINGA</name>
<homepage rdf:resource="https://singa.apache.org/" />
<asfext:pmc rdf:resource="https://singa.apache.org" />
<shortdesc>A Distributed Deep Learning Library</shortdesc>
<description>Apache SINGA is an Apache top-level project for developing an open-source machine learning library. It provides a flexible architecture for scalable distributed training, is extensible to run over a wide range of hardware, and has a focus on healthcare applications.</description>
<mailing-list rdf:resource="https://singa.apache.org/docs/mail-lists/" />
<download-page rdf:resource="https://singa.apache.org/docs/downloads/" />
<programming-language>C++</programming-language>
<category rdf:resource="https://projects.apache.org/category/big-data" />
<release>
<Version>
<name>Apache SINGA 4.0.0</name>
<created>2023-04-07</created>
<revision>4.0.0</revision>
</Version>
</release>
<repository>
<SVNRepository>
<location rdf:resource="https://dist.apache.org/repos/dist/dev/singa/"/>
<browse rdf:resource="https://dist.apache.org/repos/dist/release/singa/"/>
</SVNRepository>
</repository>
<repository>
<GitRepository>
<location rdf:resource="https://github.com/apache/singa"/>
<browse rdf:resource="https://github.com/apache/singa"/>
</GitRepository>
</repository>
<maintainer>
<foaf:Person>
<foaf:name>LUO ZHAOJING</foaf:name>
<foaf:mbox rdf:resource="mailto:[email protected]"/>
</foaf:Person>
</maintainer>
</Project>
</rdf:RDF>

24 changes: 24 additions & 0 deletions examples/armnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

## ARM-Net: Adaptive Relation Modeling Network for Structured Data

![version](https://img.shields.io/badge/version-v3.5-green)
![python](https://img.shields.io/badge/python-3.8.3-blue)
![singa](https://img.shields.io/badge/singa-3.1.0-orange)

This folder contains our Singa implementation of [ARM-Net: Adaptive Relation Modeling Network for Structured Data](https://dl.acm.org/doi/10.1145/3448016.3457321).
4 changes: 4 additions & 0 deletions examples/cifar_distributed_cnn/run-rtx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ mpiexec -np 8 python train_mpi.py mlp cifar100 -l 0.015 -b 32
mpiexec -np 8 python train_mpi.py alexnet mnist -l 0.015 -b 32
mpiexec -np 8 python train_mpi.py alexnet cifar10 -l 0.015 -b 32
mpiexec -np 8 python train_mpi.py alexnet cifar100 -l 0.015 -b 32

# xceptionnet
mpiexec -np 8 python train_mpi.py xceptionnet mnist -l 0.015 -b 32
mpiexec -np 8 python train_mpi.py xceptionnet cifar10 -l 0.015 -b 32
2 changes: 2 additions & 0 deletions examples/cnn/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# under the License.
#

#!/usr/bin/env python -W ignore::DeprecationWarning

### mnist
python train_cnn.py mlp mnist
python train_cnn.py cnn mnist
Expand Down
44 changes: 44 additions & 0 deletions examples/malaria_cnn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# Singa for Malaria Detection Task

## Malaria

Malaria is caused by parasites and could be transmitted through infected mosquitoes. There are about 200 million cases worldwide, and about 400,000 deaths per year, therefore, malaria does lots of harm to global health.

Although Malaria is a curable disease, inadequate diagnostics make it harder to reduce mortality, as a result, a fast and reliable diagnostic test is a promising and effective way to fight malaria.

To mitigate the problem, we use Singa to implement a machine learning model to help with Malaria diagnosis. The dataset is from Kaggle https://www.kaggle.com/datasets/miracle9to9/files1?resource=download. Please download the dataset before running the scripts.

## Structure

* `data` includes the scripts for preprocessing Malaria image datasets.

* `model` includes the CNN model construction codes by creating
a subclass of `Module` to wrap the neural network operations
of each model.

* `train_cnn.py` is the training script, which controls the training flow by
doing BackPropagation and SGD update.

## Command
```bash
python train_cnn.py cnn malaria -dir pathToDataset
```
Loading

0 comments on commit e62ebfc

Please sign in to comment.