Preheat your oven: Start by preheating your oven to 350°F (175°C). Grease a 9x13 inch baking dish or line it with parchment paper for easy removal.
Prepare the sweet potatoes: Peel and chop your sweet potatoes, then boil them in water until fork-tender, about 15-20 minutes. Drain and mash until smooth, measuring out 2 cups.
Make the batter: In a large mixing bowl, beat together 1/2 cup of softened butter and 1 cup granulated sugar until light and fluffy. Add in the 2 eggs and 2 teaspoons of vanilla extract, mixing well.
Combine dry ingredients: In a separate bowl, whisk together 2 cups flour, 2 teaspoons baking powder, 1 teaspoon baking soda, 1 teaspoon ground cinnamon, and 1/2 teaspoon salt.
Mix the sweet potatoes: Gradually add the mashed sweet potatoes to the sugar mixture, blending until fully combined. Then, alternate adding the dry ingredients and 1/2 cup of milk, starting and ending with the flour mixture, mixing just until combined. If desired, fold in 1/2 cup chopped pecans or walnuts at this stage.
Bake the cake: Pour the batter into your prepared baking dish and spread it evenly. Bake in the preheated oven for 30-35 minutes, or until a toothpick comes out clean from the center.
Prepare the glaze: While the cake is baking, prepare the cream cheese glaze. In a medium bowl, beat together 8 ounces of softened cream cheese, 1 cup powdered sugar, 2 tablespoons milk, and 1 teaspoon vanilla extract until smooth and creamy.
Cool and glaze: Once the cake is done baking, remove it from the oven and let it cool in the pan for 10-15 minutes. After cooling, generously drizzle the cream cheese glaze over the warm cake and allow it to set before slicing.