Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Notebook clean-up and run verification #3551

Merged
merged 7 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 67 additions & 12 deletions notebooks/applications/CostMatrix.ipynb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -12,6 +13,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -22,6 +24,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -36,6 +39,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -44,10 +48,12 @@
"| Author Credit | Date | Update | cuGraph Version | Test Hardware |\n",
"| --------------|------------|------------------|-----------------|----------------|\n",
"| Brad Rees | 06/21/2022 | created | 22.08 | V100 w 32 GB, CUDA 11.5\n",
"| Don Acosta | 06/28/2022 | modified | 22.08 | V100 w 32 GB, CUDA 11.5"
"| Don Acosta | 06/28/2022 | modified | 22.08 | V100 w 32 GB, CUDA 11.5\n",
"| Don Acosta | 05/18/2023 | modified for SSSP change | 23.06 nightly | A6000 w 48 GB, CUDA 11.7"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -79,6 +85,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -117,6 +124,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -177,6 +185,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -206,6 +215,7 @@
" tmp = _d.copy()\n",
" tmp['src'] += id\n",
" tmp['dst'] += id\n",
" tmp['wt'] = 1.0\n",
" _d = cudf.concat([_d,tmp])\n",
" id = id * 2\n",
" return _d"
Expand All @@ -232,6 +242,15 @@
"print()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gdf2"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -245,6 +264,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -280,6 +300,7 @@
" seeds = cudf.DataFrame()\n",
" seeds['dst'] = [((offset * x) + x) for x in range(num_copies)]\n",
" seeds['src'] = ghost_node_id\n",
" seeds['wt'] = 1.0\n",
" \n",
" _d = cudf.concat([_df, seeds])\n",
" \n",
Expand All @@ -306,6 +327,16 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"gdf_with_ghost"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -322,6 +353,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -339,7 +371,7 @@
"outputs": [],
"source": [
"%time\n",
"G.from_cudf_edgelist(gdf_with_ghost, source='src', destination='dst', renumber=False)"
"G.from_cudf_edgelist(gdf_with_ghost, source='src', destination='dst', edge_attr='wt',renumber=False)"
]
},
{
Expand All @@ -353,6 +385,16 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"G.edgelist.weights"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -361,6 +403,16 @@
"replicated data is connected through that node. This will include extraneous ghost node related data which will be removed in later steps."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(ghost_id)\n",
"print(G.number_of_nodes())"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -381,6 +433,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -397,6 +450,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -415,6 +469,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -432,6 +487,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -449,6 +505,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -465,6 +522,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -535,6 +593,7 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -563,7 +622,7 @@
" gdf_with_ghost, ghost_id = add_ghost_node(data, N)\n",
" \n",
" G = cugraph.Graph(directed=True)\n",
" G.from_cudf_edgelist(gdf_with_ghost, source='src', destination='dst', renumber=False)\n",
" G.from_cudf_edgelist(gdf_with_ghost, source='src', destination='dst', edge_attr='wt',renumber=False)\n",
" \n",
" X = cugraph.sssp(G, ghost_id)\n",
" \n",
Expand Down Expand Up @@ -599,11 +658,12 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"___\n",
"Copyright (c) 2022, NVIDIA CORPORATION.\n",
"Copyright (c) 2022-2023, NVIDIA CORPORATION.\n",
"\n",
"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\n",
"\n",
Expand All @@ -614,9 +674,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "cugraph_dev",
"display_name": "cugraph_0426",
"language": "python",
"name": "cugraph_dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -628,12 +688,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
},
"vscode": {
"interpreter": {
"hash": "cee8a395f2f0c5a5bcf513ae8b620111f4346eff6dc64e1ea99c951b2ec68604"
}
"version": "3.10.10"
}
},
"nbformat": 4,
Expand Down
Loading