diff --git a/.gitignore b/.gitignore index 603ee4b05..9755d86dc 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ error_log.txt docs/cuopt/source/cuopt-c/lp-milp/cuopt-cli-help.txt docs/cuopt/source/cuopt-server/client-api/sh-cli-help.txt docs/cuopt/source/cuopt-server/server-api/server-cli-help.txt +docs/cuopt/source/cuopt-cli/cuopt-cli-help.txt docs/cuopt/source/cuopt_spec.yaml python/cuopt_self_hosted/cuopt_sh_client/tests/utils/certs/*.key docs/cuopt/build diff --git a/README.md b/README.md index 04cee3911..bdc881d1e 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Review the [CONTRIBUTING.md](CONTRIBUTING.md) file for information on how to con - [cuopt (Python) documentation](https://docs.nvidia.com/cuopt/user-guide/latest/introduction.html) - [libcuopt (C++/CUDA) documentation](https://docs.nvidia.com/cuopt/user-guide/latest/introduction.html) - [Examples and Notebooks](https://github.com/NVIDIA/cuopt-examples) +- [Test cuopt with Brev](https://brev.nvidia.com/launchable/deploy?launchableID=env-2qIG6yjGKDtdMSjXHcuZX12mDNJ): Examples notebooks are pulled and hosted on [Brev](https://docs.nvidia.com/brev/latest/). ## Installation diff --git a/THIRD_PARTY_LICENSES b/THIRD_PARTY_LICENSES deleted file mode 100644 index ca53fd9c4..000000000 --- a/THIRD_PARTY_LICENSES +++ /dev/null @@ -1,791 +0,0 @@ -================================================== -Third Party Licenses -================================================== - -h5py License ---------------------- - - Copyright Notice and Statement for the h5py Project - - Copyright (c) 2008 Andrew Collette and contributors - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR 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. - - -FastAPI License ---------------------- - - Copyright (c) 2023 Frederick Jansen - Copyright (c) 2014 Bruno M. Custódio - - 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. - - -uvicorn License ---------------------- - - Copyright (c) 2017-present, Encode OSS Ltd. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 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. - - -pandas License ---------------------- - - BSD 3-Clause License - - Copyright (c) 2008-2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team - All rights reserved. - - Copyright (c) 2011-2024, Open source contributors. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR 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. - - -cupy License ---------------------- - - - Copyright (c) 2015 Preferred Infrastructure, Inc. - Copyright (c) 2015 Preferred Networks, Inc. - - 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. - - -numpy License ---------------------- - - - Copyright (c) 2005-2021, NumPy Developers. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - * Neither the name of the NumPy Developers nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR 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. - - -numpydoc License ---------------------- - - - Copyright (C) 2008 Stefan van der Walt , Pauli Virtanen - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR 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. - - -Scipy License ---------------------- - - - Copyright (c) 2001-2002 Enthought, Inc. 2003-2019, SciPy Developers. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR 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. - - -pybase64 License ---------------------- - - - BSD 2-Clause License - - Copyright (c) 2017-2019, Matthieu Darbois - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR 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. - - -ZipFile License ---------------------- - - PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 - -------------------------------------------- - - 1. This LICENSE AGREEMENT is between the Python Software Foundation - ("PSF"), and the Individual or Organization ("Licensee") accessing and - otherwise using this software ("Python") in source or binary form and - its associated documentation. - - 2. Subject to the terms and conditions of this License Agreement, PSF hereby - grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, - analyze, test, perform and/or display publicly, prepare derivative works, - distribute, and otherwise use Python alone or in any derivative version, - provided, however, that PSF's License Agreement and PSF's notice of copyright, - i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation; - All Rights Reserved" are retained in Python alone or in any derivative version - prepared by Licensee. - - 3. In the event Licensee prepares a derivative work that is based on - or incorporates Python or any part thereof, and wants to make - the derivative work available to others as provided herein, then - Licensee hereby agrees to include in any such work a brief summary of - the changes made to Python. - - 4. PSF is making Python available to Licensee on an "AS IS" - basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR - IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND - DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT - INFRINGE ANY THIRD PARTY RIGHTS. - - 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON - FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS - A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, - OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - - 6. This License Agreement will automatically terminate upon a material - breach of its terms and conditions. - - 7. Nothing in this License Agreement shall be deemed to create any - relationship of agency, partnership, or joint venture between PSF and - Licensee. This License Agreement does not grant permission to use PSF - trademarks or trade name in a trademark sense to endorse or promote - products or services of Licensee, or any third party. - - 8. By copying, installing or otherwise using Python, Licensee - agrees to be bound by the terms and conditions of this License - Agreement. - - - BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 - ------------------------------------------- - - BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 - - 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an - office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the - Individual or Organization ("Licensee") accessing and otherwise using - this software in source or binary form and its associated - documentation ("the Software"). - - 2. Subject to the terms and conditions of this BeOpen Python License - Agreement, BeOpen hereby grants Licensee a non-exclusive, - royalty-free, world-wide license to reproduce, analyze, test, perform - and/or display publicly, prepare derivative works, distribute, and - otherwise use the Software alone or in any derivative version, - provided, however, that the BeOpen Python License is retained in the - Software, alone or in any derivative version prepared by Licensee. - - 3. BeOpen is making the Software available to Licensee on an "AS IS" - basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR - IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND - DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT - INFRINGE ANY THIRD PARTY RIGHTS. - - 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE - SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS - AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY - DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - - 5. This License Agreement will automatically terminate upon a material - breach of its terms and conditions. - - 6. This License Agreement shall be governed by and interpreted in all - respects by the law of the State of California, excluding conflict of - law provisions. Nothing in this License Agreement shall be deemed to - create any relationship of agency, partnership, or joint venture - between BeOpen and Licensee. This License Agreement does not grant - permission to use BeOpen trademarks or trade names in a trademark - sense to endorse or promote products or services of Licensee, or any - third party. As an exception, the "BeOpen Python" logos available at - http://www.pythonlabs.com/logos.html may be used according to the - permissions granted on that web page. - - 7. By copying, installing or otherwise using the software, Licensee - agrees to be bound by the terms and conditions of this License - Agreement. - - - CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 - --------------------------------------- - - 1. This LICENSE AGREEMENT is between the Corporation for National - Research Initiatives, having an office at 1895 Preston White Drive, - Reston, VA 20191 ("CNRI"), and the Individual or Organization - ("Licensee") accessing and otherwise using Python 1.6.1 software in - source or binary form and its associated documentation. - - 2. Subject to the terms and conditions of this License Agreement, CNRI - hereby grants Licensee a nonexclusive, royalty-free, world-wide - license to reproduce, analyze, test, perform and/or display publicly, - prepare derivative works, distribute, and otherwise use Python 1.6.1 - alone or in any derivative version, provided, however, that CNRI's - License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) - 1995-2001 Corporation for National Research Initiatives; All Rights - Reserved" are retained in Python 1.6.1 alone or in any derivative - version prepared by Licensee. Alternately, in lieu of CNRI's License - Agreement, Licensee may substitute the following text (omitting the - quotes): "Python 1.6.1 is made available subject to the terms and - conditions in CNRI's License Agreement. This Agreement together with - Python 1.6.1 may be located on the Internet using the following - unique, persistent identifier (known as a handle): 1895.22/1013. This - Agreement may also be obtained from a proxy server on the Internet - using the following URL: http://hdl.handle.net/1895.22/1013";. - - 3. In the event Licensee prepares a derivative work that is based on - or incorporates Python 1.6.1 or any part thereof, and wants to make - the derivative work available to others as provided herein, then - Licensee hereby agrees to include in any such work a brief summary of - the changes made to Python 1.6.1. - - 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" - basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR - IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND - DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS - FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT - INFRINGE ANY THIRD PARTY RIGHTS. - - 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON - 1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS - A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, - OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - - 6. This License Agreement will automatically terminate upon a material - breach of its terms and conditions. - - 7. This License Agreement shall be governed by the federal - intellectual property law of the United States, including without - limitation the federal copyright law, and, to the extent such - U.S. federal law does not apply, by the law of the Commonwealth of - Virginia, excluding Virginia's conflict of law provisions. - Notwithstanding the foregoing, with regard to derivative works based - on Python 1.6.1 that incorporate non-separable material that was - previously distributed under the GNU General Public License (GPL), the - law of the Commonwealth of Virginia shall govern this License - Agreement only as to issues arising under or with respect to - Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this - License Agreement shall be deemed to create any relationship of - agency, partnership, or joint venture between CNRI and Licensee. This - License Agreement does not grant permission to use CNRI trademarks or - trade name in a trademark sense to endorse or promote products or - services of Licensee, or any third party. - - 8. By clicking on the "ACCEPT" button where indicated, or by copying, - installing or otherwise using Python 1.6.1, Licensee agrees to be - bound by the terms and conditions of this License Agreement. - - ACCEPT - - - CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 - -------------------------------------------------- - - Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, - The Netherlands. All rights reserved. - - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, - provided that the above copyright notice appear in all copies and that - both that copyright notice and this permission notice appear in - supporting documentation, and that the name of Stichting Mathematisch - Centrum or CWI not be used in advertising or publicity pertaining to - distribution of the software without specific, written prior - permission. - - STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO - THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE - FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT - OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION - ---------------------------------------------------------------------- - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - - -uuid License ---------------------- - - This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and - the Individual or Organization ("Licensee") accessing and otherwise using Python - 3.9.16 software in source or binary form and its associated documentation. - - 2. Subject to the terms and conditions of this License Agreement, PSF hereby - grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, - analyze, test, perform and/or display publicly, prepare derivative works, - distribute, and otherwise use Python 3.9.16 alone or in any derivative - version, provided, however, that PSF's License Agreement and PSF's notice of - copyright, i.e., "Copyright (c) 2001-2023 Python Software Foundation; All Rights - Reserved" are retained in Python 3.9.16 alone or in any derivative version - prepared by Licensee. - - 3. In the event Licensee prepares a derivative work that is based on or - incorporates Python 3.9.16 or any part thereof, and wants to make the - derivative work available to others as provided herein, then Licensee hereby - agrees to include in any such work a brief summary of the changes made to Python - 3.9.16. - - 4. PSF is making Python 3.9.16 available to Licensee on an "AS IS" basis. - PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF - EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR - WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE - USE OF PYTHON 3.9.16 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. - - 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 3.9.16 - FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF - MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 3.9.16, OR ANY DERIVATIVE - THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - - 6. This License Agreement will automatically terminate upon a material breach of - its terms and conditions. - - 7. Nothing in this License Agreement shall be deemed to create any relationship - of agency, partnership, or joint venture between PSF and Licensee. This License - Agreement does not grant permission to use PSF trademarks or trade name in a - trademark sense to endorse or promote products or services of Licensee, or any - third party. - - 8. By copying, installing or otherwise using Python 3.9.16, Licensee agrees - to be bound by the terms and conditions of this License Agreement. - - -boto3 License ---------------------- - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -psutil License ---------------------- - - BSD 3-Clause License - - Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of the psutil authors nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR 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. - - -Apache 2.0 License ---------------------- - - All contributions after December 1, 2017 released under dual license - either Apache 2.0 License or the BSD 3-Clause License. Contributions before December 1, 2017 - except those those explicitly relicensed - are released only under the BSD 3-Clause License. - - - Self-Checkout Guidance for Use of Unmodified Permissively-licensed Software - 1) The initial commit of this software to revision control should be "as-received" from the source listed above. If not feasible to submit to revision control, you can attach the unmodified sources to a tracking bug for this library/feature; in either case, indicate the location and date from which the source code was received in the change log or bug comment. - - If you submit the source to source control, please cite this OSRB bug number in the perforce changelist description or git commit message, so that it is easier to correlate the imported source with this request. - - 2) Product documentation must indicate this software is present, and the specific copyright and license terms that apply. The technical publications team for your project can provide you guidance with this - if you require further information please contact us again. - - -msgpack-numpy License ------------------------- - - Copyright (c) 2013-2022, Lev E. Givon. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Lev E. Givon nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 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. - - -jsonref License ---------------------- - - The MIT License - - Copyright (C) 2013 Chase Sterling - - 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. diff --git a/ci/test_wheel_cuopt.sh b/ci/test_wheel_cuopt.sh index e601073ad..da3ebec1e 100755 --- a/ci/test_wheel_cuopt.sh +++ b/ci/test_wheel_cuopt.sh @@ -49,4 +49,13 @@ cd ./datasets ./get_test_data.sh --solomon ./get_test_data.sh --tsp cd - + +RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)" +export RAPIDS_DATASET_ROOT_DIR + +# Run CLI tests +timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh + +# Run Python tests RAPIDS_DATASET_ROOT_DIR=./datasets timeout 30m python -m pytest --verbose --capture=no ./python/cuopt/cuopt/tests/ + diff --git a/cpp/include/cuopt/linear_programming/cuopt_c.h b/cpp/include/cuopt/linear_programming/cuopt_c.h index 30e5d2f83..f64906531 100644 --- a/cpp/include/cuopt/linear_programming/cuopt_c.h +++ b/cpp/include/cuopt/linear_programming/cuopt_c.h @@ -27,26 +27,30 @@ extern "C" { #endif -/* @brief A ``cuOptOptimizationProblem`` object contains a representation of +/** + * @brief A ``cuOptOptimizationProblem`` object contains a representation of * an LP or MIP. It is created by ``cuOptCreateProblem`` or ``cuOptCreateRangedProblem``. * It is passed to ``cuOptSolve``. It should be destroyed using ``cuOptDestroyProblem``. */ typedef void* cuOptOptimizationProblem; -/* @brief A ``cuOptSolverSettings`` object contains parameter settings and other information +/** + * @brief A ``cuOptSolverSettings`` object contains parameter settings and other information * for an LP or MIP solve. It is created by ``cuOptCreateSolverSettings``. It is passed to * ``cuOptSolve``. It should be destroyed using ``cuOptDestroySolverSettings``. */ typedef void* cuOptSolverSettings; -/* @brief A ``cuOptSolution`` object contains the solution to an LP or MIP. It is created by +/** + * @brief A ``cuOptSolution`` object contains the solution to an LP or MIP. It is created by * ``cuOptSolve``. It should be destroyed using ``cuOptDestroySolution``. */ typedef void* cuOptSolution; #if CUOPT_INSTANTIATE_FLOAT -/* @brief The type of the floating point number used by the solver. Use ``cuOptGetFloatSize`` +/** + * @brief The type of the floating point number used by the solver. Use ``cuOptGetFloatSize`` * to get the number of bytes in the floating point type. */ typedef float cuopt_float_t; @@ -54,27 +58,31 @@ typedef float cuopt_float_t; #endif #if CUOPT_INSTANTIATE_DOUBLE -/* @brief The type of the floating point number used by the solver. Use ``cuOptGetFloatSize`` +/** + * @brief The type of the floating point number used by the solver. Use ``cuOptGetFloatSize`` * to get the size of the floating point type. */ typedef double cuopt_float_t; #endif #if CUOPT_INSTANTIATE_INT32 -/* @brief The type of the integer number used by the solver. Use ``cuOptGetIntSize`` +/** + * @brief The type of the integer number used by the solver. Use ``cuOptGetIntSize`` * to get the size of the integer type. */ typedef int32_t cuopt_int_t; #endif #if CUOPT_INSTANTIATE_INT64 -/* @brief The type of the integer number used by the solver. Use ``cuOptGetIntSize`` +/** + * @brief The type of the integer number used by the solver. Use ``cuOptGetIntSize`` * to get the size of the integer type. */ typedef int64_t cuopt_int_t; #endif -/* @brief Get the size of the float type. +/** + * @brief Get the size of the float type. * * @return The size in bytes of the float type. */ @@ -85,7 +93,8 @@ int8_t cuOptGetFloatSize(); */ int8_t cuOptGetIntSize(); -/* @brief Read an optimization problem from an MPS file. +/** + * @brief Read an optimization problem from an MPS file. * * @param[in] filename - The path to the MPS file. * @@ -102,7 +111,7 @@ cuopt_int_t cuOptReadProblem(const char* filename, cuOptOptimizationProblem* pro * minimize/maximize cᵀx + offset * subject to A x {=, ≤, ≥} b * l ≤ x ≤ u - * xᵢ ∈ ℤ for some i + * x_i integer for some i * @endverbatim * * @param[in] num_constraints The number of constraints diff --git a/datasets/mip/sample.mps b/datasets/mip/sample.mps new file mode 100644 index 000000000..3bcc1e446 --- /dev/null +++ b/datasets/mip/sample.mps @@ -0,0 +1,26 @@ +* Optimal solution -28 +NAME MIP_SAMPLE +ROWS + N OBJ + L C1 + L C2 + L C3 +COLUMNS + MARK0001 'MARKER' 'INTORG' + X1 OBJ -7 + X1 C1 -1 + X1 C2 5 + X1 C3 -2 + X2 OBJ -2 + X2 C1 2 + X2 C2 1 + X2 C3 -2 + MARK0001 'MARKER' 'INTEND' +RHS + RHS C1 4 + RHS C2 20 + RHS C3 -7 +BOUNDS + UP BOUND X1 10 + UP BOUND X2 10 +ENDATA diff --git a/docs/cuopt/source/conf.py b/docs/cuopt/source/conf.py index 4dc52f90d..f8f634b96 100644 --- a/docs/cuopt/source/conf.py +++ b/docs/cuopt/source/conf.py @@ -30,7 +30,7 @@ subprocess.run(["cuopt_sh", "--help"], stdout=open("cuopt-server/client-api/sh-cli-help.txt", "w")) # Run cuopt_cli help command and save output -subprocess.run(["cuopt_cli", "--help"], stdout=open("cuopt-c/lp-milp/cuopt-cli-help.txt", "w")) +subprocess.run(["cuopt_cli", "--help"], stdout=open("cuopt-cli/cuopt-cli-help.txt", "w")) with open('cuopt_spec.yaml', 'w') as f: yaml.dump(get_openapi( @@ -146,6 +146,10 @@ html_theme_options = { 'collapse_navigation': False, 'navigation_depth': 6, + "switcher": { + "json_url": "../versions1.json", + "version_match": release, + }, 'extra_head': [ # Adding Adobe Analytics ''' @@ -159,11 +163,15 @@ "show_nav_level": 2 } + + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] html_css_files = ["swagger-nvidia.css"] +html_extra_path = ["project.json", "versions1.json"] + # -- Options for Breathe (Doxygen) ---------------------------------------- breathe_projects = { diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst index 133f76c65..4bbe62922 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-example.rst @@ -5,7 +5,7 @@ LP C API Examples Example With Data ----------------- -This example demonstrates how to use the cuOpt linear programming solver in C. More details on the API can be found in `C API `_. +This example demonstrates how to use the LP solver in C. More details on the API can be found in `C API `_. Copy the code below into a file called ``lp_example.c``: @@ -208,7 +208,7 @@ Copy the code below into a file called ``lp_example.c``: } -Need to find PATH for cuopt_c.h and libcuopt.so, if you know the path, please add it to these path variables directly. Else, run the following commands to find the path and assign it to the path variables. +It is necessary to have the path for include and library dirs ready, if you know the paths, please add them to the path variables directly. Otherwise, run the following commands to find the path and assign it to the path variables. The following commands are for Linux and might fail in cases where the cuopt library is not installed or there are multiple cuopt libraries in the system. If you have built it locally, libcuopt.so will be in the build directory ``cpp/build`` and include directoy would be ``cpp/include``. @@ -423,7 +423,7 @@ Copy the code below into a file called ``lp_example_mps.c``: } -Need to find PATH for cuopt_c.h and libcuopt.so, if you know the path, please add it to these path variables directly. Else, run the following commands to find the path and assign it to the path variables. +It is necessary to have the path for include and library dirs ready, if you know the paths, please add them to the path variables directly. Otherwise, run the following commands to find the path and assign it to the path variables. The following commands are for Linux and might fail in cases where the cuopt library is not installed or there are multiple cuopt libraries in the system. If you have built it locally, libcuopt.so will be in the build directory ``cpp/build`` and include directoy would be ``cpp/include``. @@ -494,53 +494,3 @@ You should see the following output: x2 = 0.000000 Solver completed successfully! - - -Example for CLI with MPS file ------------------------------- - -This example demonstrates how to use the cuOpt CLI to solve an MPS file and how to set the parameters for the solver. - -.. code-block:: bash - - echo "* optimize - * cost = -0.2 * VAR1 + 0.1 * VAR2 - * subject to - * 3 * VAR1 + 4 * VAR2 <= 5.4 - * 2.7 * VAR1 + 10.1 * VAR2 <= 4.9 - NAME good-1 - ROWS - N COST - L ROW1 - L ROW2 - COLUMNS - VAR1 COST -0.2 - VAR1 ROW1 3 ROW2 2.7 - VAR2 COST 0.1 - VAR2 ROW1 4 ROW2 10.1 - RHS - RHS1 ROW1 5.4 ROW2 4.9 - ENDATA" > sample.mps - - # Solve the MPS file with the additional parameter settings - cuopt_cli sample.mps --absolute-primal-tolerance 0.0001 --pdlp-solver-mode 1 --time-limit 5 - - -This should give you the following output: - -.. code-block:: bash - :caption: Output - - [2025-05-17 15:22:16:143587] [CUOPT] [info ] Running file sample.mps - Solving a problem with 2 constraints 2 variables (0 integers) and 4 nonzeros - Objective offset 0.000000 scaling_factor 1.000000 - Running concurrent - - Dual simplex finished in 0.00 seconds - Iter Primal Obj. Dual Obj. Gap Primal Res. Dual Res. Time - 0 +0.00000000e+00 +0.00000000e+00 0.00e+00 0.00e+00 2.00e-01 0.011s - PDLP finished - Concurrent time: 0.012s - Solved with dual simplex - Status: Optimal Objective: -3.60000000e-01 Iterations: 1 Time: 0.012s - diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst index 199b3f691..fbd312430 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst @@ -3,76 +3,52 @@ cuOpt LP/MILP C API Reference This section contains the cuOpt LP/MILP C API reference. -Types ------ +Integer and Floating-Point Types +--------------------------------- + +cuOpt may be built with 32 or 64 bit integer and floating-point types. The C API uses a `typedef` for floating point and integer types to abstract the size of these types. -.. doxygentypedef:: cuOptOptimizationProblem -.. doxygentypedef:: cuOptSolverSettings -.. doxygentypedef:: cuOptSolution -.. doxygentypedef:: cuopt_float_t .. doxygentypedef:: cuopt_int_t +.. doxygentypedef:: cuopt_float_t -Status Constants ----------------- +You may use the following functions to determine the number of bytes used to represent these types in your build + +.. doxygenfunction:: cuOptGetIntSize +.. doxygenfunction:: cuOptGetFloatSize + +Status Codes +------------ + +Every function in the C API returns a status code that indicates success or failure. The following status codes are defined -.. Status code constants .. doxygendefine:: CUOPT_SUCCESS .. doxygendefine:: CUOPT_INVALID_ARGUMENT .. doxygendefine:: CUOPT_MPS_FILE_ERROR .. doxygendefine:: CUOPT_MPS_PARSE_ERROR -Parameter Constants -------------------- +Optimization Problem +-------------------- -These constants would be used as the parameter name in the `cuOptSetParameter `_ and `cuOptGetParameter `_ functions. More details on the parameters can be found in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. +An optimization problem is represented via a `cuOptOptimizationProblem` -.. LP/MIP parameter string constants -.. doxygendefine:: CUOPT_ABSOLUTE_DUAL_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_DUAL_TOLERANCE -.. doxygendefine:: CUOPT_ABSOLUTE_PRIMAL_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_PRIMAL_TOLERANCE -.. doxygendefine:: CUOPT_ABSOLUTE_GAP_TOLERANCE -.. doxygendefine:: CUOPT_RELATIVE_GAP_TOLERANCE -.. doxygendefine:: CUOPT_INFEASIBILITY_DETECTION -.. doxygendefine:: CUOPT_STRICT_INFEASIBILITY -.. doxygendefine:: CUOPT_PRIMAL_INFEASIBLE_TOLERANCE -.. doxygendefine:: CUOPT_DUAL_INFEASIBLE_TOLERANCE -.. doxygendefine:: CUOPT_ITERATION_LIMIT -.. doxygendefine:: CUOPT_TIME_LIMIT -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE -.. doxygendefine:: CUOPT_METHOD -.. doxygendefine:: CUOPT_PER_CONSTRAINT_RESIDUAL -.. doxygendefine:: CUOPT_SAVE_BEST_PRIMAL_SO_FAR -.. doxygendefine:: CUOPT_FIRST_PRIMAL_FEASIBLE -.. doxygendefine:: CUOPT_LOG_FILE -.. doxygendefine:: CUOPT_MIP_ABSOLUTE_TOLERANCE -.. doxygendefine:: CUOPT_MIP_RELATIVE_TOLERANCE -.. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE -.. doxygendefine:: CUOPT_MIP_SCALING -.. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY -.. doxygendefine:: CUOPT_NUM_CPU_THREADS +.. doxygentypedef:: cuOptOptimizationProblem -Termination Status Constants ----------------------------- +Optimization problems can be created via three different functions -These constants would be used as the termination status in the `cuOptGetTerminationStatus `_ function. +.. doxygenfunction:: cuOptReadProblem +.. doxygenfunction:: cuOptCreateProblem +.. doxygenfunction:: cuOptCreateRangedProblem -.. LP/MIP termination status constants -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_NO_TERMINATION -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_OPTIMAL -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_INFEASIBLE -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_UNBOUNDED -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_ITERATION_LIMIT -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_TIME_LIMIT -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_NUMERICAL_ERROR -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_PRIMAL_FEASIBLE -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_FEASIBLE_FOUND -.. doxygendefine:: CUOPT_TERIMINATION_STATUS_CONCURRENT_LIMIT +A optimization problem must be destroyed with the following function + +.. doxygenfunction:: cuOptDestroyProblem + +Certain constants are needed to define an optimization problem. These constants are described below. Objective Sense Constants ------------------------- -These would be used as the objective sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. +These constants are used to define the objective sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. .. doxygendefine:: CUOPT_MINIMIZE .. doxygendefine:: CUOPT_MAXIMIZE @@ -80,7 +56,7 @@ These would be used as the objective sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. +These constants are used to define the constraint sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. .. doxygendefine:: CUOPT_LESS_THAN .. doxygendefine:: CUOPT_GREATER_THAN @@ -89,7 +65,7 @@ These would be used as the constraint sense in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. +These constants are used to define the the variable type in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. .. doxygendefine:: CUOPT_CONTINUOUS .. doxygendefine:: CUOPT_INTEGER @@ -97,39 +73,15 @@ These would be used as the variable type in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. +This constant may be used to represent infinity in the `cuOptCreateProblem `_ and `cuOptCreateRangedProblem `_ functions. .. doxygendefine:: CUOPT_INFINITY -PDLP Solver Mode Constants --------------------------- - -These would be used as the PDLP solver mode while setting solver parameters using `cuOptSetParameter `_. - -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_STABLE1 -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_STABLE2 -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_METHODICAL1 -.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_FAST1 - -Method Constants ----------------- - -These would be used as the method while setting solver parameters using `cuOptSetParameter `_. - -.. doxygendefine:: CUOPT_METHOD_CONCURRENT -.. doxygendefine:: CUOPT_METHOD_PDLP -.. doxygendefine:: CUOPT_METHOD_DUAL_SIMPLEX +Querying an optimization problem +-------------------------------- -Functions ---------- +The following functions may be used to get information about an `cuOptimizationProblem` -.. cuopt_c.h functions -.. doxygenfunction:: cuOptGetFloatSize -.. doxygenfunction:: cuOptGetIntSize -.. doxygenfunction:: cuOptReadProblem -.. doxygenfunction:: cuOptCreateProblem -.. doxygenfunction:: cuOptCreateRangedProblem -.. doxygenfunction:: cuOptDestroyProblem .. doxygenfunction:: cuOptGetNumConstraints .. doxygenfunction:: cuOptGetNumVariables .. doxygenfunction:: cuOptGetObjectiveSense @@ -144,10 +96,29 @@ Functions .. doxygenfunction:: cuOptGetVariableLowerBounds .. doxygenfunction:: cuOptGetVariableUpperBounds .. doxygenfunction:: cuOptGetVariableTypes +.. doxygenfunction:: cuOptIsMIP + + +Solver Settings +--------------- + +Settings are used to configure the LP/MIP solvers. All settings are stored in a `cuOptSolverSettings` object. + + +.. doxygentypedef:: cuOptSolverSettings + +A `cuOptSolverSettings` object is created with `cuOptCreateSolverSettings` + .. doxygenfunction:: cuOptCreateSolverSettings + +When you are done with a solve you should destroy a `cuOptSolverSettings` object with + .. doxygenfunction:: cuOptDestroySolverSettings -More details on the parameters can be found in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. + +Setting Parameters +------------------ +The following functions are used to set and get parameters. You can find more details on the available parameters in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. .. doxygenfunction:: cuOptSetParameter .. doxygenfunction:: cuOptGetParameter @@ -155,9 +126,76 @@ More details on the parameters can be found in the `LP/MILP settings <../../lp-m .. doxygenfunction:: cuOptGetIntegerParameter .. doxygenfunction:: cuOptSetFloatParameter .. doxygenfunction:: cuOptGetFloatParameter -.. doxygenfunction:: cuOptIsMIP + + +Parameter Constants +------------------- + +These constants are used as the parameter name in the `cuOptSetParameter `_ , `cuOptGetParameter `_ and similar functions. More details on the parameters can be found in the `LP/MILP settings <../../lp-milp-settings.html>`_ section. + +.. LP/MIP parameter string constants +.. doxygendefine:: CUOPT_ABSOLUTE_DUAL_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_DUAL_TOLERANCE +.. doxygendefine:: CUOPT_ABSOLUTE_PRIMAL_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_PRIMAL_TOLERANCE +.. doxygendefine:: CUOPT_ABSOLUTE_GAP_TOLERANCE +.. doxygendefine:: CUOPT_RELATIVE_GAP_TOLERANCE +.. doxygendefine:: CUOPT_INFEASIBILITY_DETECTION +.. doxygendefine:: CUOPT_STRICT_INFEASIBILITY +.. doxygendefine:: CUOPT_PRIMAL_INFEASIBLE_TOLERANCE +.. doxygendefine:: CUOPT_DUAL_INFEASIBLE_TOLERANCE +.. doxygendefine:: CUOPT_ITERATION_LIMIT +.. doxygendefine:: CUOPT_TIME_LIMIT +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE +.. doxygendefine:: CUOPT_METHOD +.. doxygendefine:: CUOPT_PER_CONSTRAINT_RESIDUAL +.. doxygendefine:: CUOPT_SAVE_BEST_PRIMAL_SO_FAR +.. doxygendefine:: CUOPT_FIRST_PRIMAL_FEASIBLE +.. doxygendefine:: CUOPT_LOG_FILE +.. doxygendefine:: CUOPT_MIP_ABSOLUTE_TOLERANCE +.. doxygendefine:: CUOPT_MIP_RELATIVE_TOLERANCE +.. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE +.. doxygendefine:: CUOPT_MIP_SCALING +.. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY +.. doxygendefine:: CUOPT_NUM_CPU_THREADS + +PDLP Solver Mode Constants +-------------------------- + +These constants are used to configure `CUOPT_PDLP_SOLVER_MODE` via `cuOptSetIntegerParameter `_. + +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_STABLE1 +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_STABLE2 +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_METHODICAL1 +.. doxygendefine:: CUOPT_PDLP_SOLVER_MODE_FAST1 + +Method Constants +---------------- + +These constants are used to configure `CUOPT_METHOD` via `cuOptSetIntegerParameter `_. + +.. doxygendefine:: CUOPT_METHOD_CONCURRENT +.. doxygendefine:: CUOPT_METHOD_PDLP +.. doxygendefine:: CUOPT_METHOD_DUAL_SIMPLEX + + +Solving an LP or MIP +-------------------- + +LP and MIP solves are performed by calling the `cuOptSolve` function + .. doxygenfunction:: cuOptSolve -.. doxygenfunction:: cuOptDestroySolution + + +Solution +-------- + +The output of a solve is a `cuOptSolution` object. + +.. doxygentypedef:: cuOptSolution + +The following functions may be used to access information from a `cuOptSolution` + .. doxygenfunction:: cuOptGetTerminationStatus .. doxygenfunction:: cuOptGetPrimalSolution .. doxygenfunction:: cuOptGetObjectiveValue @@ -167,12 +205,23 @@ More details on the parameters can be found in the `LP/MILP settings <../../lp-m .. doxygenfunction:: cuOptGetDualSolution .. doxygenfunction:: cuOptGetReducedCosts -CLI for LP and MILP -=================== +When you are finished with a `cuOptSolution` object you should destory it with -The cuOpt CLI is a command-line interface for the cuOpt LP/MILP API. It is a simple interface that allows you to solve LP/MILP problems from the command line. This CLI is based on C/C++ API. +.. doxygenfunction:: cuOptDestroySolution -.. literalinclude:: cuopt-cli-help.txt - :language: shell - :linenos: +Termination Status Constants +---------------------------- +These constants define the termination status received from the `cuOptGetTerminationStatus `_ function. + +.. LP/MIP termination status constants +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_NO_TERMINATION +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_OPTIMAL +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_INFEASIBLE +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_UNBOUNDED +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_ITERATION_LIMIT +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_TIME_LIMIT +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_NUMERICAL_ERROR +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_PRIMAL_FEASIBLE +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_FEASIBLE_FOUND +.. doxygendefine:: CUOPT_TERIMINATION_STATUS_CONCURRENT_LIMIT diff --git a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst index 042a291e5..da08c0509 100644 --- a/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst +++ b/docs/cuopt/source/cuopt-c/lp-milp/milp-examples.rst @@ -5,7 +5,7 @@ MILP C API Examples Example With Data ----------------- -This example demonstrates how to use the cuOpt solver in C to solve a MILP problem. More details on the API can be found in `C API `_. +This example demonstrates how to use the MILP solver in C. More details on the API can be found in `C API `_. Copy the code below into a file called ``milp_example.c``: @@ -212,7 +212,7 @@ Copy the code below into a file called ``milp_example.c``: } -Need to find PATH for cuopt_c.h and libcuopt.so, if you know the path, please add it to these path variables directly. Else, run the following commands to find the path and assign it to the path variables. +It is necessary to have the path for include and library dirs ready, if you know the paths, please add them to the path variables directly. Otherwise, run the following commands to find the path and assign it to the path variables. The following commands are for Linux and might fail in cases where the cuopt library is not installed or there are multiple cuopt libraries in the system. If you have built it locally, libcuopt.so will be in the build directory ``cpp/build`` and include directoy would be ``cpp/include``. @@ -432,7 +432,7 @@ Copy the code below into a file called ``milp_example_mps.c``: } -Need to find PATH for cuopt_c.h and libcuopt.so, if you know the path, please add it to these path variables directly. Else, run the following commands to find the path and assign it to the path variables. +It is necessary to have the path for include and library dirs ready, if you know the paths, please add them to the path variables directly. Otherwise, run the following commands to find the path and assign it to the path variables. The following commands are for Linux and might fail in cases where the cuopt library is not installed or there are multiple cuopt libraries in the system. If you have built it locally, libcuopt.so will be in the build directory ``cpp/build`` and include directoy would be ``cpp/include``. @@ -451,7 +451,6 @@ Build and run the example # Create a MPS file in the current directory echo "* Example 2.1 from N & W * Optimal solution -28 - * Has 5 nodes NAME EXAMPLE21 ROWS N OBJ @@ -530,78 +529,3 @@ You should see the following output: x2 = 0.000000 Solver completed successfully! - -Example for CLI with MPS file ------------------------------- - -This example demonstrates how to use the cuOpt CLI to solve an MPS file and how to set the parameters for the solver. - -.. code-block:: bash - - # Create a MPS file in the current directory - echo "* Example 2.1 from N & W - * Optimal solution -28 - * Has 5 nodes - NAME EXAMPLE21 - ROWS - N OBJ - L C1 - L C2 - L C3 - COLUMNS - MARK0001 'MARKER' 'INTORG' - X1 OBJ -7 - X1 C1 -1 - X1 C2 5 - X1 C3 -2 - X2 OBJ -2 - X2 C1 2 - X2 C2 1 - X2 C3 -2 - MARK0001 'MARKER' 'INTEND' - RHS - RHS C1 4 - RHS C2 20 - RHS C3 -7 - BOUNDS - UP BOUND X1 10 - UP BOUND X2 10 - ENDATA" > sample.mps - - # Solve the MPS file with the additional parameter settings - cuopt_cli sample.mps --mip-absolute-tolerance 0.0001 --method 0 --time-limit 5 - -This should give you the following output: - -.. code-block:: bash - :caption: Output - - [2025-05-17 15:29:35:484327] [CUOPT] [info ] Running file sample.mps - Solving a problem with 3 constraints 2 variables (2 integers) and 6 nonzeros - Objective offset 0.000000 scaling_factor 1.000000 - After trivial presolve updated 3 constraints 2 variables - Running presolve! - After trivial presolve updated 3 constraints 2 variables - Solving LP root relaxation - Scaling matrix. Maximum column norm 1.225464e+00 - Dual Simplex Phase 1 - Dual feasible solution found. - Dual Simplex Phase 2 - Iter Objective Primal Infeas Perturb Time - 1 -3.04000000e+01 7.57868205e+00 0.00e+00 0.00 - - Root relaxation solution found in 3 iterations and 0.00s - Root relaxation objective -3.01818182e+01 - - Strong branching on 2 fractional variables - | Explored | Unexplored | Objective | Bound | Depth | Iter/Node | Gap | Time - 0 1 +inf -3.018182e+01 1 0.0e+00 - 0.00 - B 3 1 -2.700000e+01 -2.980000e+01 2 6.7e-01 10.4% 0.00 - B&B added a solution to population, solution queue size 0 with objective -27 - B 4 0 -2.800000e+01 -2.980000e+01 2 7.5e-01 6.4% 0.00 - B&B added a solution to population, solution queue size 1 with objective -28 - Explored 4 nodes in 0.00s. - Absolute Gap 0.000000e+00 Objective -2.8000000000000004e+01 Lower Bound -2.8000000000000004e+01 - Optimal solution found. - Consuming B&B solutions, solution queue size 2 - Solution objective: -28.000000 , relative_mip_gap 0.000000 solution_bound -28.000000 presolve_time 0.026420 total_solve_time 0.000000 max constraint violation 0.000000 max int violation 0.000000 max var bounds violation 0.000000 nodes 4 simplex_iterations diff --git a/docs/cuopt/source/cuopt-c/quick-start.rst b/docs/cuopt/source/cuopt-c/quick-start.rst index 8388b47f0..18a18334a 100644 --- a/docs/cuopt/source/cuopt-c/quick-start.rst +++ b/docs/cuopt/source/cuopt-c/quick-start.rst @@ -11,14 +11,6 @@ Installation pip --- -For CUDA 11.x: - -.. code-block:: bash - - # This is deprecated module and not longer used, but share same name for the CLI, so we need to uninstall it first if it exists. - pip uninstall cuopt-thin-client - pip install --extra-index-url=https://pypi.nvidia.com libcuopt-cu11==25.5.* - For CUDA 12.x: .. code-block:: bash @@ -33,15 +25,6 @@ Conda NVIDIA cuOpt can be installed with Conda (via `miniforge `_) from the ``nvidia`` channel: -For CUDA 11.x: - -.. code-block:: bash - - # This is deprecated module and not longer used, but share same name for the CLI, so we need to uninstall it first if it exists. - conda remove cuopt-thin-client - conda install -c rapidsai -c conda-forge -c nvidia \ - libcuopt=25.5.* python=3.12 cuda-version=11.8 - For CUDA 12.x: .. code-block:: bash @@ -52,65 +35,4 @@ For CUDA 12.x: libcuopt=25.5.* python=3.12 cuda-version=12.8 -Please visit examples under each section to learn how to use the cuOpt C API. - - -Smoke Test -========== - -To test the installation, you can run the following command: - -.. code-block:: bash - - cuopt_cli --help - -This will print the help message for the cuOpt CLI. If the installation is successful, you should see the help message. - -Lets try to solve a simple LP problem: - -.. code-block:: bash - - echo "* optimize - * cost = 0.2 * VAR1 + 0.1 * VAR2 - * subject to - * 3 * VAR1 + 4 * VAR2 <= 5.4 - * 2.7 * VAR1 + 10.1 * VAR2 <= 4.9 - NAME good-1 - ROWS - N COST - L ROW1 - L ROW2 - COLUMNS - VAR1 COST 0.2 - VAR1 ROW1 3 ROW2 2.7 - VAR2 COST 0.1 - VAR2 ROW1 4 ROW2 10.1 - RHS - RHS1 ROW1 5.4 ROW2 4.9 - ENDATA" > sample.mps - - cuopt_cli sample.mps - -This will print the solution to the console. - -.. code-block:: text - - [2025-05-17 12:33:16:228750] [CUOPT] [info ] Running file sample.mps - Solving a problem with 2 constraints 2 variables (0 integers) and 4 nonzeros - Objective offset 0.000000 scaling_factor 1.000000 - Running concurrent - - Dual simplex finished in 0.00 seconds - Iter Primal Obj. Dual Obj. Gap Primal Res. Dual Res. Time - 0 +0.00000000e+00 +0.00000000e+00 0.00e+00 0.00e+00 2.00e-01 0.024s - PDLP finished - Concurrent time: 0.026s - Solved with dual simplex - Status: Optimal Objective: -3.60000000e-01 Iterations: 1 Time: 0.026s - - - - - - - +Please visit examples under each section to learn how to use the cuOpt C API. \ No newline at end of file diff --git a/docs/cuopt/source/cuopt-cli/cli-examples.rst b/docs/cuopt/source/cuopt-cli/cli-examples.rst new file mode 100644 index 000000000..43cc14790 --- /dev/null +++ b/docs/cuopt/source/cuopt-cli/cli-examples.rst @@ -0,0 +1,143 @@ +Examples +======== + +Basic Usage +########### + +To solve a simple LP problem using cuopt_cli: + +.. code-block:: bash + + # Create a sample MPS file + echo "* optimize + * cost = -0.2 * VAR1 + 0.1 * VAR2 + * subject to + * 3 * VAR1 + 4 * VAR2 <= 5.4 + * 2.7 * VAR1 + 10.1 * VAR2 <= 4.9 + NAME SAMPLE + ROWS + N COST + L ROW1 + L ROW2 + COLUMNS + VAR1 COST -0.2 + VAR1 ROW1 3.0 + VAR1 ROW2 2.7 + VAR2 COST 0.1 + VAR2 ROW1 4.0 + VAR2 ROW2 10.1 + RHS + RHS1 ROW1 5.4 + RHS1 ROW2 4.9 + ENDATA" > sample.mps + + # Solve using default settings + cuopt_cli sample.mps + +This should give you the following output: + +.. code-block:: bash + :caption: Output + + Running file sample.mps + Solving a problem with 2 constraints 2 variables (0 integers) and 4 nonzeros + Objective offset 0.000000 scaling_factor 1.000000 + Running concurrent + + Dual simplex finished in 0.00 seconds + Iter Primal Obj. Dual Obj. Gap Primal Res. Dual Res. Time + 0 +0.00000000e+00 +0.00000000e+00 0.00e+00 0.00e+00 2.00e-01 0.033s + PDLP finished + Concurrent time: 0.036s + Solved with dual simplex + Status: Optimal Objective: -3.60000000e-01 Iterations: 1 Time: 0.036s + + +Mixed Integer Programming Example +################################# + +Here's an example of solving a Mixed Integer Programming (MIP) problem using the CLI: + +.. code-block:: bash + + echo "* Optimal solution -28 + NAME MIP_SAMPLE + ROWS + N OBJ + L C1 + L C2 + L C3 + COLUMNS + MARK0001 'MARKER' 'INTORG' + X1 OBJ -7 + X1 C1 -1 + X1 C2 5 + X1 C3 -2 + X2 OBJ -2 + X2 C1 2 + X2 C2 1 + X2 C3 -2 + MARK0001 'MARKER' 'INTEND' + RHS + RHS C1 4 + RHS C2 20 + RHS C3 -7 + BOUNDS + UP BOUND X1 10 + UP BOUND X2 10 + ENDATA" > mip_sample.mps + + # Solve the MIP problem with custom parameters + cuopt_cli --mip-absolute-gap 0.01 --time-limit 10 mip_sample.mps + +This should produce output similar to: + +.. code-block:: bash + :caption: Output + + Running file mip_sample.mps + Solving a problem with 3 constraints 2 variables (2 integers) and 6 nonzeros + Objective offset 0.000000 scaling_factor 1.000000 + After trivial presolve updated 3 constraints 2 variables + Running presolve! + After trivial presolve updated 3 constraints 2 variables + Solving LP root relaxation + Scaling matrix. Maximum column norm 1.225464e+00 + Dual Simplex Phase 1 + Dual feasible solution found. + Dual Simplex Phase 2 + Iter Objective Primal Infeas Perturb Time + 1 -3.04000000e+01 7.57868205e+00 0.00e+00 0.00 + + Root relaxation solution found in 3 iterations and 0.00s + Root relaxation objective -3.01818182e+01 + + Strong branching on 2 fractional variables + | Explored | Unexplored | Objective | Bound | Depth | Iter/Node | Gap | Time + 0 1 +inf -3.018182e+01 1 0.0e+00 - 0.00 + B 3 1 -2.700000e+01 -2.980000e+01 2 6.7e-01 10.4% 0.00 + B&B added a solution to population, solution queue size 0 with objective -27 + B 4 0 -2.800000e+01 -2.980000e+01 2 7.5e-01 6.4% 0.00 + B&B added a solution to population, solution queue size 1 with objective -28 + Explored 4 nodes in 0.00s. + Absolute Gap 0.000000e+00 Objective -2.8000000000000004e+01 Lower Bound -2.8000000000000004e+01 + Optimal solution found. + Consuming B&B solutions, solution queue size 2 + Solution objective: -28.000000 , relative_mip_gap 0.000000 solution_bound -28.000000 presolve_time 0.227418 total_solve_time 0.000000 max constraint violation 0.000000 max int violation 0.000000 max var bounds violation 0.000000 nodes 4 simplex_iterations 3 + + +Using Solver Parameters +####################### + +You can customize the solver behavior using various command line parameters. Some examples are shown below: + +.. code-block:: bash + + # Set absolute primal tolerance and PDLP solver mode + cuopt_cli --absolute-primal-tolerance 0.0001 --pdlp-solver-mode 1 sample.mps + + # Set time limit and use specific solver method + cuopt_cli --time-limit 5 --method pdlp sample.mps + + # Turn off output to console and output the logs to a .log file and solution to a .sol file + cuopt_cli --log-to-console false --log-file mip_sample.log --solution-file mip_sample.sol mip_sample.mps diff --git a/docs/cuopt/source/cuopt-cli/index.rst b/docs/cuopt/source/cuopt-cli/index.rst new file mode 100644 index 000000000..fd0eae529 --- /dev/null +++ b/docs/cuopt/source/cuopt-cli/index.rst @@ -0,0 +1,21 @@ +Command Line Interface +====================== + +The cuopt_cli is a command-line interface for LP/MILP solvers that accepts MPS format files as input models. It provides command-line arguments to control all solver settings and parameters when solving linear and mixed-integer programming problems. + +.. toctree:: + :maxdepth: 3 + :caption: Command Line Interface Overview + :name: Command Line Interface Overview + :titlesonly: + + quick-start.rst + +.. toctree:: + :maxdepth: 3 + :caption: Usage + :name: Usage + :titlesonly: + + cli-examples.rst + diff --git a/docs/cuopt/source/cuopt-cli/quick-start.rst b/docs/cuopt/source/cuopt-cli/quick-start.rst new file mode 100644 index 000000000..d59d56836 --- /dev/null +++ b/docs/cuopt/source/cuopt-cli/quick-start.rst @@ -0,0 +1,20 @@ +================= +Quickstart Guide +================= + +cuopt_cli is built as part of the libcuopt package and you can follow these `instructions <../cuopt-c/quick-start.html>`_ to install it. + +To see all available options and their descriptions: + + +.. code-block:: bash + + cuopt_cli --help + +This will display the complete list of command-line arguments and their usage: + +.. literalinclude:: cuopt-cli-help.txt + :language: shell + :linenos: + +Please refer to `parameter settings <../lp-milp-settings.html>`_ for more details on default values and other options. \ No newline at end of file diff --git a/docs/cuopt/source/cuopt-python/quick-start.rst b/docs/cuopt/source/cuopt-python/quick-start.rst index 1e43d7cd5..27d46b8f7 100644 --- a/docs/cuopt/source/cuopt-python/quick-start.rst +++ b/docs/cuopt/source/cuopt-python/quick-start.rst @@ -10,12 +10,6 @@ Installation pip --- -For CUDA 11.x: - -.. code-block:: bash - - pip install --extra-index-url=https://pypi.nvidia.com cuopt-cu11==25.5.* - For CUDA 12.x: .. code-block:: bash @@ -28,13 +22,6 @@ Conda NVIDIA cuOpt can be installed with Conda (via `miniforge `_) from the ``nvidia`` channel: -For CUDA 11.x: - -.. code-block:: bash - - conda install -c rapidsai -c conda-forge -c nvidia \ - cuopt=25.5.* python=3.12 cuda-version=11.8 - For CUDA 12.x: .. code-block:: bash @@ -64,6 +51,11 @@ This will start an interactive session with cuOpt pre-installed and ready to use Make sure you have the NVIDIA Container Toolkit installed on your system to enable GPU support in containers. See the `installation guide `_ for details. +Brev +---- + +NVIDIA cuOpt can be tested with `Brev Launchable `_ with `example notebooks `_. For more details, please refer to the `Brev documentation `_. + Smoke Test ---------- diff --git a/docs/cuopt/source/cuopt-server/quick-start.rst b/docs/cuopt/source/cuopt-server/quick-start.rst index f0910b57e..4aba1e6aa 100644 --- a/docs/cuopt/source/cuopt-server/quick-start.rst +++ b/docs/cuopt/source/cuopt-server/quick-start.rst @@ -8,12 +8,6 @@ Installation pip --- -For CUDA 11.x: - -.. code-block:: bash - - pip install --extra-index-url=https://pypi.nvidia.com cuopt-server-cu11==25.5.* cuopt-sh==25.5.* - For CUDA 12.x: .. code-block:: bash @@ -26,13 +20,6 @@ Conda cuOpt Server can be installed with Conda (via `miniforge `_) from the ``nvidia`` channel: -For CUDA 11.x: - -.. code-block:: bash - - conda install -c rapidsai -c conda-forge -c nvidia \ - cuopt-server=25.5.* cuopt-sh=25.5.* python=3.12 cuda-version=11.8 - For CUDA 12.x: .. code-block:: bash @@ -86,15 +73,19 @@ Step 4: Pull the container: .. code-block:: bash - docker pull nvcr.io/nvidia/cuopt:25.5.0 + docker pull CONTAINER_IMAGE_PATH The container includes both the Python API and self-hosted server components. To run the container: .. code-block:: bash - docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 nvcr.io/nvidia/cuopt/cuopt:25.5.0 /bin/bash -c "python3 -m cuopt_server.cuopt_service" + docker run --gpus all -it --rm -p 8000:8000 -e CUOPT_SERVER_PORT=8000 /bin/bash -c "python3 -m cuopt_server.cuopt_service" + +Brev +---- +NVIDIA cuOpt can be tested with `Brev Launchable `_ with `example notebooks `_. For more details, please refer to the `Brev documentation `_. Smoke Test ---------- diff --git a/docs/cuopt/source/faq.rst b/docs/cuopt/source/faq.rst index 1f6134aaf..ba1c48d39 100644 --- a/docs/cuopt/source/faq.rst +++ b/docs/cuopt/source/faq.rst @@ -8,8 +8,8 @@ General FAQ .. dropdown:: Where can I find cuOpt container images? There are two options: - - Nvidia docker hub (https://hub.docker.com/r/nvidia/) - - Nvidia NGC registry (https://catalog.ngc.nvidia.com/orgs/nvidia/teams/cuopt/containers/cuopt/tags) with NVAIE license. + - NVIDIA docker hub (https://hub.docker.com/r/nvidia/) + - NVIDIA NGC registry (https://catalog.ngc.nvidia.com/orgs/nvidia/teams/cuopt/containers/cuopt/tags) with NVAIE license. .. dropdown:: How to get a NVAIE license? @@ -79,7 +79,7 @@ General FAQ .. dropdown:: Why is NVIDIA cuOpt running longer than the supplied time limit? - #. The time limit supplied governs the run time of the solver only, but there are other overheads such as ``network delay``, ``etl``, ``validation`` or ``solver being busy with other requests``. + #. The time limit supplied governs the run time of the solver only, but there are other overheads such as network delay, ETL, validation or the solver being busy with other requests. #. The complete round-trip solve time might be more than what was set. @@ -337,25 +337,24 @@ Linear Programming FAQs - Hardware: If using self-hosted, you should use a recent server-grade GPU. We recommend H100 SXM (not the PCIE version). - Tolerance: The set tolerance usually has a massive impact on performance. Try the lowest possible value using ``set_optimality_tolerance`` until you have reached your lowest possible acceptable accuracy. - - PDLP Solver mode: PDLP solver mode will change the way PDLP internally optimizes the problem. The mode choice made using ``set_pdlp_solver_mode`` can drastically impact how fast a specific problem will be solved. You should test the different modes to see which one fits your problem best. - - Infeasibility detection: By default, the solver will try to detect infeasible problems which takes time. If you know your problem is feasible, use ``set_infeasibility_detection`` to make solving faster. + - PDLP Solver mode: PDLP solver mode will change the way PDLP internally optimizes the problem. The mode choice can drastically impact how fast a specific problem will be solved. You should test the different modes to see which one fits your problem best. - Batch mode: In case you know upfront that you need to solve multiple LP problems, instead of solving them sequentially, you should use the batch mode which can solve multiple LPs in parallel. .. dropdown:: What solver mode should I choose? We cannot predict up-front which solver mode will work best for a particular problem. The only way to know is to test. Once you know a solver mode is good on a class of problems, it should also be good on other similar problems. -.. dropdown:: What threshold should I use? +.. dropdown:: What tolerance should I use? - The choice entirely depends on the level of accuracy you need for your problem. A higher threshold will always result in a faster result. In general, 1e-2 is low accuracy, 1e-4 regular, 1e-6 high, 1e-8 very high. + The choice entirely depends on the level of accuracy you need for your problem. A looser tolerance will always result in a faster result. For PDLP, 1e-2 relative tolerance is low accuracy, 1e-4 is regular, 1e-6 is high, and 1e-8 is very high. .. dropdown:: What are the limitations of the LP solver? - #. There is no inherit limit imposed on the number of variables, number of constraints, or number of non-zeros you can have in a MILP or LP, except the restrictions due to the number of bits in integer and the amount of memory in the CPU and GPU. + #. There is no inherit limit imposed on the number of variables, number of constraints, or number of non-zeros you can have in a MILP or LP, except the restrictions due to the number of bits in an integer and the amount of memory in the CPU and GPU. Depending on these factors, the problems that can be solved can vary, for example: - - On a H100 SXM with 80GB memory, these are few examples of the problems that can be solved: + - On a H100 SXM with 80GB memory, here are few examples of the problems that can be solved: - 10M rows/constraints, 10M columns/variables, and 2B non-zeros in the constraint matrix. - 74.5M rows/constraints, 74.5M columns/variables, and 1.49B non-zeros in the constraint matrix. @@ -369,7 +368,7 @@ Mixed Integer Linear Programming FAQs Depending on these factors, the problems that can be solved can vary, for example: - On a H100 SXM with 80GB memory, this is the biggest dataset that was tested: - - Number of non-zeros/coefficient matrix size supported - 27 million (dataset: miplib2017). + - 27 million non-zeros coefficients on a problem from MIPLIB2017. Container FAQs ------------------------------ diff --git a/docs/cuopt/source/index.rst b/docs/cuopt/source/index.rst index 73fa971ed..44f50db16 100644 --- a/docs/cuopt/source/index.rst +++ b/docs/cuopt/source/index.rst @@ -50,16 +50,15 @@ Server (cuopt-server) Server Overview - -=============================== -Third Party Modeling Languages -=============================== +================================== +Command Line Interface (cuopt-cli) +================================== .. toctree:: - :maxdepth: 4 - :caption: Third Party Modeling Languages - :name: Third Party Modeling Languages + :maxdepth: 1 + :caption: Command Line Interface + :name: Command Line Interface - Third Party Modeling Languages + Command Line Interface Overview ============= Resources diff --git a/docs/cuopt/source/introduction.rst b/docs/cuopt/source/introduction.rst index 900259575..85949293c 100644 --- a/docs/cuopt/source/introduction.rst +++ b/docs/cuopt/source/introduction.rst @@ -2,7 +2,7 @@ Introduction ========================== -**NVIDIA® cuOpt™** is a GPU-accelerated optimization library that excels in `Mixed Integer Linear Programming (MILP) `_, `Linear Programming (LP) `_, and `Vehicle Routing Problems (VRP) `_. It enables solutions for large-scale problems with millions of variables and constraints, offering seamless deployment across hybrid and multi-cloud environments. +**NVIDIA® cuOpt™** is a GPU-accelerated optimization library that solves `Mixed Integer Linear Programming (MILP) `_, `Linear Programming (LP) `_, and `Vehicle Routing Problems (VRP) `_. It enables solutions for large-scale problems with millions of variables and constraints, offering seamless deployment across hybrid and multi-cloud environments. Using accelerated computing, NVIDIA® cuOpt optimizes operations research and logistics by enabling better, faster decisions. @@ -29,8 +29,8 @@ For example, the TSP has several applications in planning and logistics, where a The VRP generalizes the TSP to solve for the optimal set of routes for a fleet of vehicles in order to deliver to a given set of customers. The PDP adds the possibility of two different types of services, namely pickup or delivery, whereas in VRP all customers require the same service be performed at a customer location. -How cuOpt Solves Routing Problem ------------------------------------ +How cuOpt Solves the Routing Problem +------------------------------------- cuOpt first generates an initial population of solutions, then iteratively improves the population until the time limit is reached, and picks the best solution from the population. @@ -38,66 +38,67 @@ cuOpt first generates an initial population of solutions, then iteratively impro The Necessity for Heuristics ------------------------------ -Given the time and computational resources required for brute-force enumeration, obtaining the exact optimal solution is not realistic at all. However, there are well-studied heuristics that yield near-optimal solutions for very large problems within a reasonable time, and NVIDIA cuOpt focuses on using these heuristics. +Given the time and computational resources required for brute-force enumeration, obtaining the exact optimal solution is not realistic. However, there are well-studied heuristics that yield near-optimal solutions for very large problems within a reasonable time, and NVIDIA cuOpt focuses on using these heuristics. Linear Programming (LP) ======================= -**Linear Programming** is a technique for optimizing a linear objective function over a feasible region defined by a set of linear inequality and equality constraints. For example, please consider the following. +**Linear Programming** is a technique for optimizing a linear objective function over a feasible region defined by a set of linear inequality and equality constraints. For example, consider the following system constraints -Given system constraints: - - 2x + 4 y >= 230 + 2x + 4y >= 230 - 3x + 2y < 190 + 3x + 2y <= 190 x >= 0 y >= 0, -Maximize objective function: +and suppose we want to maximize the objective function - f(x,y) = 5x + 3y + f(x,y) = 5x + 3y. +This is a linear program. -How cuOpt Solves LP Problem ------------------------------- -cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve LPs at large scale. This implements a gradient descent, enhanced by heuristics, performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU. + +How cuOpt Solves the Linear Programming Problem +------------------------------------------------ +cuOpt includes an LP solver based on `PDLP `__, a new First-Order Method (FOM) used to solve large-scale LPs. This solver implements gradient descent, enhanced by heuristics, and performing massively parallel operations efficiently by leveraging the latest NVIDIA GPUs. + +In addition to PDLP, cuOpt includes a dual simplex solver that runs on the CPU. Both algorithms can be run concurrently on the GPU and CPU. Mixed Integer Linear Programming (MILP) ========================================= -A **Mixed Integer Linear Program** is a variant of a Linear Program, where some of the variables are restricted to take on only integer values, while other variables can vary continuously. NVIDIA cuOpt uses a hybrid GPU/CPU method: running primal heuristics on the GPU and improving the dual bound on the CPU. +A **Mixed Integer Linear Program** is a variant of a Linear Program where some of the variables are restricted to take on only integer values, while other variables can vary continuously. NVIDIA cuOpt uses a hybrid GPU/CPU method: running primal heuristics on the GPU and improving the dual bound on the CPU. -Given system constraints: +For example, consider the following system of constraints: 2x + 4y >= 230 - 3x + 2y < 190 + 3x + 2y <= 190 x >= 0 and x is integer y >= 0 and y is continuous, +and suppose we wish to maximize the objective function + f(x,y) = 5x + 3y. -Maximize objective function: - - f(x,y) = 5x + 3y +This is a mixed integer linear program. +Although MILPs seems similar to a LPs, they require much more computation to solve. -Although this problem seems similar to a Linear Program, it is actually much more difficult. - -How cuOpt Solves MILP Problem ------------------------------- +How cuOpt Solves the Mixed-Integer Linear Programming Problem +------------------------------------------------------------- -MILP solver is a hybrid GPU/CPU algorithm. Primal heuristics including local search, feasibility pump, and feasibility jump are performed on the GPU to improve the primal bound. Branch and bound is performed on the CPU to improve the dual bound. Integer feasible solutions are shared between both algorithms. +The MILP solver is a hybrid GPU/CPU algorithm. Primal heuristics including local search, feasibility pump, and feasibility jump are performed on the GPU to improve the primal bound. Branch and bound is performed on the CPU to improve the dual bound. Integer feasible solutions are shared between both algorithms. ============================= -API Supports +Supported APIs ============================= cuOpt supports the following APIs: @@ -110,14 +111,8 @@ cuOpt supports the following APIs: - Python support - Routing (TSP, VRP, and PDP) - Linear Programming (LP) and Mixed Integer Linear Programming (MILP) - - cuOpt includes a Python API that is used as the backend of the cuOpt server. However, we do not provide documentation for the Python API at this time. We suggest users use a third-party modeling language or the cuOpt server to access cuOpt via Python. We anticipate that the Python API will change significantly in the future. Use it at your own risk. + - cuOpt includes a Python API that is used as the backend of the cuOpt server. However, we do not provide documentation for the Python API at this time. We suggest using cuOpt server to access cuOpt via Python. We anticipate that the Python API will change significantly in the future. Use it at your own risk. - Server support - Linear Programming (LP) - Mixed Integer Linear Programming (MILP) - Routing (TSP, VRP, and PDP) -- cuOpt Third-Party Modeling Languages support (LP and MILP) - - SciPy - - PuLP - - CVXPY - - Pyomo - - AMPL \ No newline at end of file diff --git a/docs/cuopt/source/lp-features.rst b/docs/cuopt/source/lp-features.rst index 046a8e2f3..7d0adab21 100644 --- a/docs/cuopt/source/lp-features.rst +++ b/docs/cuopt/source/lp-features.rst @@ -3,31 +3,27 @@ LP Features ================== Availability ------------------------------- +------------- -NVIDIA cuOpt LP is available in 3 different ways: +The LP solver can be accessed in the following ways: -- **Third-Party Modeling Languages**: cuOpt's LP and MILP solver can be called directly from the following third-party modeling languages. This allows you to leverage GPU acceleration while maintaining your existing optimization workflow in these modeling languages. +- **C API**: A native C API that provides direct low-level access to cuOpt's LP capabilities, enabling integration into any application or system that can interface with C. - Supported modeling languages: - - SciPy - - PuLP - - CVXPY - - Pyomo - - AMPL +- **As a Self-Hosted Service**: cuOpt's LP solver can be deployed as a in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. -- **C API**: A native C API that provides direct low-level access to cuOpt's LP capabilities, enabling integration into any application or system that can interface with C. +Each option provide the same powerful linear optimization capabilities while offering flexibility in deployment and integration. -- **As a Self-Hosted Service**: cuOpt LP can be deployed as a in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. +Variable Bounds +--------------- -All three options provide the same powerful linear programming optimization capabilities while offering flexibility in deployment and integration approaches. +Lower and upper bounds can be applied to each variable. If no variable bounds are specified, the default bounds are ``[-inf,+inf]``. Constraints ----------- The constraint matrix is specified in `Compressed Sparse Row (CSR) format `_. -There are two ways to specify constraints in cuOpt LP: +There are two ways to specify constraints to the LP solver: 1. Using row_type and right-hand side: @@ -35,47 +31,42 @@ There are two ways to specify constraints in cuOpt LP: A*x {<=, =, >=} b - where A is the constraint matrix in CSR format, x is the variable vector, and b is the right-hand side vector. The relationship {<=, =, >=} is specified through the ``row_type`` parameter. + where A is the constraint matrix in CSR format, x is the variable vector, and b is the right-hand side vector. The relationship {<=, =, >=} is specified via the ``row_type`` parameter. 2. Using constraint bounds: - Alternatively, constraints can be specified as double-sided inequalities: + Alternatively, constraints can be specified as two-sided inequalities: lb <= A*x <= ub - where lb and ub are vectors of lower and upper bounds respectively. This form allows specifying both bounds in a single constraint. + where lb and ub are vectors of lower and upper bounds respectively. This form allows specifying both bounds on a single constraint. Warm Start ----------- -.. note:: - Warm start is not supported C API and third-party modeling languages. - -Warm starts allow a user to provide an initial solution to help PDLP converge faster - -For warm start, the initial ``primal`` and ``dual`` solution can be provided to the solver in data. - -Alternatively, previously run solutions can be used to warm start a new request to boost the speed to the solution. `Examples `_ are shared on the self-hosted page. - -Variable Bounds ---------------- - -Lower and upper bounds can be applied to each variable. If no variable bounds are specified, the default bounds will be ``[-inf,+inf]``. +A warm starts allow a user to provide an initial solution to help PDLP converge faster. The initial ``primal`` and ``dual`` solutions can be specified by the user. +Alternatively, previously run solutions can be used to warm start a new solve to decrease solve time. `Examples `_ are shared on the self-hosted page. PDLP Solver Mode ---------------- -Users can control how the solver will operate by using ``solver mode`` under ``solver config``. The mode choice can drastically impact how fast a specific problem will be solved. Users are encouraged to test different modes to see which one fits the best their problem. +Users can control how the solver will operate by specifying the PDLP solver mode. The mode choice can drastically impact how fast a specific problem will be solved. Users are encouraged to test different modes to see which one fits the best their problem. Method ------ -**Concurrent**: The default method for solving linear programs. When concurrent is selected, cuOpt runs two solves at the same time: PDLP on the GPU and dual simplex on the CPU. A solution is returned from the solve that finishes first. +**Concurrent**: The default method for solving linear programs. When concurrent is selected, cuOpt runs two algorithms at the same time: PDLP on the GPU and dual simplex on the CPU. A solution is returned from the algorithm that finishes first. + +**PDLP**: Primal-Dual Hybrid Gradient for Linear Program is an algorithm for solving large-scale linear programming problems on the GPU. PDLP does not attempt to any matrix factorizations during the course of the solve. Select this method if your LP is so large that factorization will not fit into memory. By default PDLP solves to low relative tolerance and the solutions it returns do not lie at a vertex of the feasible region. Enable crossover to obtain a highly accurate basic solution from a PDLP solution. + +**Dual Simplex**: Dual simplex is the simplex method applied to the dual of the linear program. Dual simplex requires the basis factorization of linear program fit into memory. Select this method if your LP is small to medium sized, or if you require a high-quality basic solution. + -**PDLP**: Primal-Dual Hybrid Gradient for Linear Program is an algorithm for solving large-scale linear programming problems on the GPU. PDLP does not attempt to any matrix factorizations during the course of the solve. Select this method if your LP is so large that factorization will not fit into memory. By default PDLP solves to low relative tolerance and the solutions it returns do not lie at a vertex of the feasible region. Enable crossover if you need a highly accurate basic solution. +Crossover +--------- -**Dual Simplex**: The simplex method applied to the dual of the linear program. Dual simplex requires the basis factorization of linear program fit into memory. Select this method if your LP is small to medium sized, or if you require a highly accurate basic solution. +Crossover allows you to obtain a high-quality basic solution from the results of a PDLP solve. More details can be found `here `__. Logging Callback @@ -86,10 +77,10 @@ With logging callback, users can fetch server-side logs for additional debugs an Infeasibility Detection ----------------------- -An option under ``solver config`` in API. The PDLP solver includes the option to detect infeasible problems. If the infeasibilty detection is enabled in solver settings, PDLP will abort as soon as it concludes the problem is infeasible. - -Infeasibility detection is always enabled for dual simplex. +The PDLP solver includes the option to detect infeasible problems. If the infeasibilty detection is enabled in solver settings, PDLP will abort as soon as it concludes the problem is infeasible. +.. note:: + Infeasibility detection is always enabled for dual simplex. Time Limit ---------- @@ -98,15 +89,10 @@ The user may specify a time limit to the solver. By default the solver runs unti .. note:: - Note that ``time_limit`` applies only to solve time inside the LP solver. This does not include time for ``network transfer``, ``validation of input``, and other operations that occur outside the solver. The overhead associated with these operations are usually quite small compared to the solve time + Note that ``time_limit`` applies only to solve time inside the LP solver. This does not include time for network transfer, validation of input, and other operations that occur outside the solver. The overhead associated with these operations are usually small compared to the solve time. Batch Mode ---------- -.. note:: - Batch mode is not supported C API and third-party modeling languages. It is only available via cuOpt server. - Users can submit a set of problems which will be solved in a batch. Problems will be solved at the same time in parallel to fully utilize the GPU. Checkout `self-hosted client `_ example in thin client. - -And batch mode is supported only in server. \ No newline at end of file diff --git a/docs/cuopt/source/lp-milp-settings.rst b/docs/cuopt/source/lp-milp-settings.rst index e5dc6e65f..361f4865b 100644 --- a/docs/cuopt/source/lp-milp-settings.rst +++ b/docs/cuopt/source/lp-milp-settings.rst @@ -9,8 +9,8 @@ Please refer to examples in `C `_ and `Server Thin client `_ is shared on the self-hosted page. +User can provide a callback to receive new integer feasible solutions that improve the objective (called incumbents) while the solver is running. An `Incumbent Example `_ is shared on the self-hosted page. Logging Callback ---------------- -.. note:: - Logging callback is not supported C API and third-party modeling languages. - -A logging callback allows users to get additional information about how the solve is progressing. `Logging Callback Example `_ is shared on the self-hosted page. +A logging callback allows users to get additional information about how the solve is progressing. A `Logging Callback Example `_ is shared on the self-hosted page. Time Limit -------------- @@ -70,9 +60,4 @@ The user may specify a time limit to the solver. By default the solver runs unti .. note:: - Note that time_limit applies only to solve time inside the LP solver. This does not include time for ``network transfer``, ``validation of input``, and other operations that occur outside the solver. The overhead associated with these operations are usually quite small compared to the solve time - -Variable Bounds ---------------- - -Lower and upper bounds can be applied to each variable. If no variable bounds are specified, the default bounds will be ``[-inf,+inf]``. \ No newline at end of file + Note that time_limit applies only to solve time inside the LP solver. This does not include time for network transfer, validation of input, and other operations that occur outside the solver. The overhead associated with these operations are usually small compared to the solve time. diff --git a/docs/cuopt/source/project.json b/docs/cuopt/source/project.json new file mode 100644 index 000000000..ea33b8341 --- /dev/null +++ b/docs/cuopt/source/project.json @@ -0,0 +1 @@ +{"name": "cuopt", "version": "25.05.00", "url": "https://github.com/nvidia/cuopt", "description": "Nvidia cuOpt is a optimization engine"} \ No newline at end of file diff --git a/docs/cuopt/source/release-notes.rst b/docs/cuopt/source/release-notes.rst index 7ddb438c8..9505e2055 100644 --- a/docs/cuopt/source/release-notes.rst +++ b/docs/cuopt/source/release-notes.rst @@ -9,30 +9,25 @@ Release Notes 25.05 New Features ------------ -- Added crossover from PDLP to Dual Simplex - Added concurrent mode that runs PDLP and Dual Simplex together -- Added a LP and MILP C API for cuOpt -- PDLP enhancements -- Limit minimal absolute tolerance to 1e-12 and NoTermination is now NumericalError +- Added crossover from PDLP to Dual Simplex +- Added a C API for LP and MILP +- PDLP: Faster iterations and new more robust default PDLPSolverMode Stable2 Breaking Changes ---------------- -- FIx concurrent LP crashes and limit minimal absolute tolerance are not breaking changes. -- Limit minimal absolute tolerance to 1e-12 and NoTermination is now NumericalError +- NoTermination is now a NumericalError - Split cuOpt as libcuopt and cuopt wheel Improvements ------------ -- FIx concurrent LP crashes and limit minimal absolute tolerance are not breaking changes. -- Hook up MILP Gap parameters and add info about number of nodes explored and simplex iterations, other fixes +- Hook up MILP Gap parameters and add info about number of nodes explored and simplex iterations - FJ bug fixes, tests and improvements -- Cleanup solver settings -- Allow no time limit on MILP +- Allow no time limit in MILP - Refactor routing - Probing cache optimization -- Split cuOpt as libcuopt and cuopt wheel - Diversity improvements for routing - Enable more compile warnings and faster compile by bypassing rapids fetch - Constraint prop based on load balanced bounds update @@ -45,12 +40,13 @@ Bug Fixes - In the solution, ``termination_status`` should be cast to correct enum. - Fixed a bug using vehicle IDs in construct feasible solution algorithm. - FP recombiner probing bug fix. +- Fix concurrent LP crashes. - Fix print relative dual residual. - Handle empty problems gracefully. - Improve breaks to allow dimensions at arbitrary places in the route. - Free var elimination with a substitute variable for each free variable. - Fixed race condition when resetting vehicle IDs in heterogenous mode. -- cuOpt self-hosted client, some MILPs will not have all fields in ``lp_stats``. +- cuOpt self-hosted client, some MILPs do not have all fields in ``lp_stats``. - Fixed RAPIDS logger usage. - Handle LP state more cleanly, per solution. - Fixed routing solver intermittent failures. @@ -60,4 +56,4 @@ Bug Fixes Documentation ------------- -- Restructure documementation to accomdate new APIs \ No newline at end of file +- Restructure documementation to accomdate new APIs diff --git a/docs/cuopt/source/resources.rst b/docs/cuopt/source/resources.rst index a74a517ed..978778ef7 100644 --- a/docs/cuopt/source/resources.rst +++ b/docs/cuopt/source/resources.rst @@ -6,6 +6,9 @@ Resources `Sample Notebooks `_ ---------------------------------------------------------------------------------- +`Test cuopt with Brev `_ +------------------------------------------------------------------------------------------------------------------------ + `File a Bug `_ ----------------------------------------------------------------- diff --git a/docs/cuopt/source/routing-features.rst b/docs/cuopt/source/routing-features.rst index 5bbbdb43f..2cd5047ea 100644 --- a/docs/cuopt/source/routing-features.rst +++ b/docs/cuopt/source/routing-features.rst @@ -5,7 +5,7 @@ Routing Features Availability ------------------------------ -NVIDIA cuOpt Routing is available in two forms: +The Routing solver is available in two forms: - **As a Self-Hosted Service**: cuOpt Routing can be deployed as a service in your own infrastructure, enabling you to maintain full control while integrating it into your existing systems. For more information, see :doc:`cuopt-server/quick-start`. diff --git a/docs/cuopt/source/system-requirements.rst b/docs/cuopt/source/system-requirements.rst index 3642a0586..7313ff0ed 100644 --- a/docs/cuopt/source/system-requirements.rst +++ b/docs/cuopt/source/system-requirements.rst @@ -21,11 +21,11 @@ System Requirements - 100+ GB free space * CUDA: - - 11.2+ + - 12.0+ * NVIDIA drivers: - - 450.80.02+ - + - 525.60.13+ (linux) + - 527.41+ (windows) * OS: - Linux distributions with glibc>=2.28 (released in August 2018): * Arch Linux (minimum version 2018-08-02) @@ -37,10 +37,6 @@ System Requirements * Windows 11 with WSL2 * CUDA & NVIDIA Driver combinations: - - CUDA 11.2 with Driver 470.42.01+ - - CUDA 11.4 with Driver 470.42.01+ - - CUDA 11.5 with Driver 495.29.05+ - - CUDA 11.8 with Driver 520.61.05+ - CUDA 12.0 with Driver 525.60.13+ - CUDA 12.2 with Driver 535.86.10+ - CUDA 12.5 with Driver 555.42.06+ diff --git a/docs/cuopt/source/third_party_modeling_languages/index.rst b/docs/cuopt/source/third_party_modeling_languages/index.rst deleted file mode 100644 index c6d8f8457..000000000 --- a/docs/cuopt/source/third_party_modeling_languages/index.rst +++ /dev/null @@ -1,40 +0,0 @@ -=============================== -Third Party Modeling Languages -=============================== - - --------------------------- -CVXPY Support --------------------------- - -CVXPY may be used to generate linear and mixed integer programming problems. Specify cuOpt as the solver to use it to solve linear and mixed integer programming problems. - - --------------------------- -SciPy Support --------------------------- - -SciPy users may call cuOpt to solve linear and mixed integer programming problems using linprog and milp. You must specify cuOpt as the method to solve these problems. - - --------------------------- -PuLP Support --------------------------- - -PuLP may be used to generate linear and mixed integer programming problems. Specify cuOpt as the solver within PuLP to use it to solve LPs and MIPs. - - --------------------------- -Pyomo Support --------------------------- - -Pyomo may be used to generate linear and mixed integer programming problems. Specify cuOpt as the solver within Pyomo to use it to solve LPs and MIPs. - - --------------------------- -AMPL Support --------------------------- - -AMPL may be used to generate linear and mixed integer programming problems. Specify cuOpt as the solver within AMPL to use it to solve LPs and MIPs. - - diff --git a/python/cuopt/cuopt/linear_programming/CMakeLists.txt b/python/cuopt/cuopt/linear_programming/CMakeLists.txt index 5fd133ba7..85ef76082 100644 --- a/python/cuopt/cuopt/linear_programming/CMakeLists.txt +++ b/python/cuopt/cuopt/linear_programming/CMakeLists.txt @@ -73,3 +73,8 @@ add_subdirectory(data_model) if(DEFINED cython_lib_dir) rapids_cython_add_rpath_entries(TARGET mps_parser PATHS "${cython_lib_dir}") endif() +set(rpaths + "$ORIGIN/../lib64" + "$ORIGIN/../../rapids_logger/lib64" +) +set_property(TARGET mps_parser PROPERTY INSTALL_RPATH ${rpaths} APPEND) diff --git a/python/libcuopt/CMakeLists.txt b/python/libcuopt/CMakeLists.txt index 7b85f2275..1212ff02b 100644 --- a/python/libcuopt/CMakeLists.txt +++ b/python/libcuopt/CMakeLists.txt @@ -58,6 +58,7 @@ target_link_libraries(cuopt_cli PRIVATE argparse) set(rpaths "$ORIGIN/../lib64" + "$ORIGIN/../../rapids_logger/lib64" "$ORIGIN/../../nvidia/cublas/lib" "$ORIGIN/../../nvidia/curand/lib" "$ORIGIN/../../nvidia/cusolver/lib" diff --git a/python/libcuopt/libcuopt/_cli_wrapper.py b/python/libcuopt/libcuopt/_cli_wrapper.py new file mode 100644 index 000000000..6f3a74557 --- /dev/null +++ b/python/libcuopt/libcuopt/_cli_wrapper.py @@ -0,0 +1,27 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. +# All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed 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. + +import os +import subprocess +import sys + + +def main(): + """ + This connects to cli binary which situated under libcuopt/bin folder + """ + cli_path = os.path.join(os.path.dirname(__file__), "bin", "cuopt_cli") + sys.exit(subprocess.call([cli_path] + sys.argv[1:])) diff --git a/python/libcuopt/libcuopt/tests/test_cli.sh b/python/libcuopt/libcuopt/tests/test_cli.sh new file mode 100644 index 000000000..6b217e123 --- /dev/null +++ b/python/libcuopt/libcuopt/tests/test_cli.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed 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. + +set -euo pipefail + +# Add cuopt_cli path to PATh variable +export PATH="$(pyenv root)/versions/$(pyenv version-name)/bin:$PATH" + + +# Test the CLI + +# Add a test for the help command +cuopt_cli --help | grep -q "Usage: cuopt_cli" || (echo "Expected usage information not found" && exit 1) + +# Add a test with a simple linear programming problem + +# Run solver and check for optimal status - fail if not found + +cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/linear_programming/good-mps-1.mps | grep -q "Status: " || (echo "Expected solution not found" && exit 1) + +# Add a for mixed integer programming test with options + +cuopt_cli ${RAPIDS_DATASET_ROOT_DIR}/mip/sample.mps --mip-absolute-gap 0.01 --time-limit 10 | grep -q "Solution objective" || (echo "Expected solution objective not found" && exit 1) diff --git a/python/libcuopt/pyproject.toml b/python/libcuopt/pyproject.toml index 8dfdb4837..0e180e1fe 100644 --- a/python/libcuopt/pyproject.toml +++ b/python/libcuopt/pyproject.toml @@ -60,11 +60,14 @@ libcuopt = "libcuopt" select = [ "distro-too-large-compressed", ] - # PyPI limit is 700 MiB, fail CI before we get too close to that # 11.X size is 300M compressed and 12.x size is 600M compressed max_allowed_size_compressed = '700M' +[project.scripts] +cuopt_cli = "libcuopt._cli_wrapper:main" + + [tool.scikit-build] build-dir = "build/{wheel_tag}" cmake.build-type = "Release" diff --git a/thirdparty/THIRD_PARTY_LICENSES b/thirdparty/THIRD_PARTY_LICENSES new file mode 100644 index 000000000..290f9c35c --- /dev/null +++ b/thirdparty/THIRD_PARTY_LICENSES @@ -0,0 +1,3 @@ +================================================== +Third Party Licenses +==================================================