Preheat oven to 400 degrees. Place sweet potatoes on a parchment-lined baking sheet, and pierce each several times with a fork.
Bake until tender when pierced with the tip of a paring knife, about 45 minutes. Remove from oven and set aside to cool.
Line a rimmed baking sheet with aluminum foil and fit with a wire rack. Arrange bacon strips on rack, and sprinkle with brown sugar.
Cook until well glazed and crisp, 12 to 15 minutes. Remove from oven, let cool slightly and roughly chop.
Melt 1 tablespoon of butter in a small skillet over medium heat. Add shallots, and cook until soft and fragrant, about 2 minutes. Add rosemary, and cook 1 minute. Remove from heat.
Cut cooled potatoes in half and scoop out sweet potato flesh. Place flesh in the bowl of an electric mixer fitted with the paddle attachment.
Add remaining 2 tablespoons butter, reserved shallot mixture, egg, cream and cheese.
Mix well until combined. Transfer to food processor, and mix until very smooth. Season with salt and pepper.
Transfer mixture to a pastry bag fitted with a star tip. Pipe mixture into ramekins. Bake until golden, about 20 minutes. Remove from oven, and garnish with Gruyere, rosemary and reserved bacon. Serve immediately.